<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, MagicHash, RecordWildCards, BangPatterns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE LambdaCase #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- (c) The University of Glasgow, 2005-2007</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Running statements interactively</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Runtime.Eval</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#Resume"><span class="hs-identifier">Resume</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier">History</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#execStmt"><span class="hs-identifier">execStmt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#execStmt%27"><span class="hs-identifier">execStmt'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier">ExecOptions</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#execOptions"><span class="hs-identifier">execOptions</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecResult"><span class="hs-identifier">ExecResult</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#resumeExec"><span class="hs-identifier">resumeExec</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#runDecls"><span class="hs-identifier">runDecls</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#runDeclsWithLocation"><span class="hs-identifier">runDeclsWithLocation</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#runParsedDecls"><span class="hs-identifier">runParsedDecls</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#isStmt"><span class="hs-identifier">isStmt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#hasImport"><span class="hs-identifier">hasImport</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#isImport"><span class="hs-identifier">isImport</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#isDecl"><span class="hs-identifier">isDecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseImportDecl"><span class="hs-identifier">parseImportDecl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#SingleStep"><span class="hs-identifier">SingleStep</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#abandon"><span class="hs-identifier">abandon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#abandonAll"><span class="hs-identifier">abandonAll</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getResumeContext"><span class="hs-identifier">getResumeContext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getHistorySpan"><span class="hs-identifier">getHistorySpan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Interpreter.html#getModBreaks"><span class="hs-identifier">getModBreaks</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getHistoryModule"><span class="hs-identifier">getHistoryModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#back"><span class="hs-identifier">back</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#forward"><span class="hs-identifier">forward</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#setContext"><span class="hs-identifier">setContext</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#getContext"><span class="hs-identifier">getContext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#availsToGlobalRdrEnv"><span class="hs-identifier">availsToGlobalRdrEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getNamesInScope"><span class="hs-identifier">getNamesInScope</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getRdrNamesInScope"><span class="hs-identifier">getRdrNamesInScope</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#moduleIsInterpreted"><span class="hs-identifier">moduleIsInterpreted</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getInfo"><span class="hs-identifier">getInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#exprType"><span class="hs-identifier">exprType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#typeKind"><span class="hs-identifier">typeKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseName"><span class="hs-identifier">parseName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseInstanceHead"><span class="hs-identifier">parseInstanceHead</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getInstancesForType"><span class="hs-identifier">getInstancesForType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#getDocs"><span class="hs-identifier">getDocs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#GetDocsFailure"><span class="hs-identifier">GetDocsFailure</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#showModule"><span class="hs-identifier">showModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#moduleIsBootOrNotObjectLinkable"><span class="hs-identifier">moduleIsBootOrNotObjectLinkable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#parseExpr"><span class="hs-identifier">parseExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileParsedExpr"><span class="hs-identifier">compileParsedExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileExpr"><span class="hs-identifier">compileExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#dynCompileExpr"><span class="hs-identifier">dynCompileExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileExprRemote"><span class="hs-identifier">compileExprRemote</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#compileParsedExprRemote"><span class="hs-identifier">compileParsedExprRemote</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier">Term</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#obtainTermFromId"><span class="hs-identifier">obtainTermFromId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#obtainTermFromVal"><span class="hs-identifier">obtainTermFromVal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#reconstructType"><span class="hs-identifier">reconstructType</span></a></span><span>
</span><span id="line-45"></span><span>        </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html"><span class="hs-identifier">GHC.Runtime.Eval.Types</span></a></span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.html"><span class="hs-identifier">GHC.Runtime.Interpreter</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHCi</span></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.Types.html"><span class="hs-identifier">GHC.Runtime.Interpreter.Types</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#"><span class="hs-identifier">GHCi.Message</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#"><span class="hs-identifier">GHCi.RemoteTypes</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html"><span class="hs-identifier">GHC.Driver.Monad</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Main.html"><span class="hs-identifier">GHC.Driver.Main</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html"><span class="hs-identifier">GHC.Core.InstEnv</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html"><span class="hs-identifier">GHC.Iface.Env</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier">newInteractiveBinder</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html"><span class="hs-identifier">GHC.Core.FamInstEnv</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInst"><span class="hs-identifier">FamInst</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html"><span class="hs-identifier">GHC.Core.FVs</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html#orphNamesOfFamInst"><span class="hs-identifier">orphNamesOfFamInst</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>       </span><span class="hs-keyword">hiding</span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier">typeKind</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Type</span></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html"><span class="hs-identifier">GHC.Types.RepType</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html"><span class="hs-identifier">GHC.Tc.Types.Constraint</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html"><span class="hs-identifier">GHC.Tc.Types.Origin</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Predicate.html"><span class="hs-identifier">GHC.Core.Predicate</span></a></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Id</span></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>      </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier">varName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html"><span class="hs-identifier">GHC.Types.Avail</span></a></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html"><span class="hs-identifier">GHC.ByteCode.Types</span></a></span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Linker.html"><span class="hs-identifier">GHC.Runtime.Linker</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Linker</span></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span>
</span><span id="line-87"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#toDynName"><span class="hs-identifier">toDynName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#pretendNameIsInScope"><span class="hs-identifier">pretendNameIsInScope</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#isCTupleTyConName"><span class="hs-identifier">isCTupleTyConName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-91"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-92"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-93"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-94"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html"><span class="hs-identifier">GHC.Runtime.Heap.Inspect</span></a></span><span>
</span><span id="line-95"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-96"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-97"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-98"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-99"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html"><span class="hs-identifier">GHC.Parser.Lexer</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Lexer</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Parser.Lexer.html#P"><span class="hs-identifier">P</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#ParseResult"><span class="hs-identifier">ParseResult</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#unP"><span class="hs-identifier">unP</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#mkPStatePure"><span class="hs-identifier">mkPStatePure</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html"><span class="hs-identifier">GHC.Parser.Lexer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Parser.Lexer.html#ParserFlags"><span class="hs-identifier">ParserFlags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Parser.html"><span class="hs-identifier">GHC.Parser</span></a></span><span>       </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Parser</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Parser.html#parseStmt"><span class="hs-identifier">parseStmt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.html#parseModule"><span class="hs-identifier">parseModule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.html#parseDeclaration"><span class="hs-identifier">parseDeclaration</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Parser.html#parseImport"><span class="hs-identifier">parseImport</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-104"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Dynamic.html#"><span class="hs-identifier">Data.Dynamic</span></a></span><span>
</span><span id="line-105"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#"><span class="hs-identifier">Data.Either</span></a></span><span>
</span><span id="line-106"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntMap.html#"><span class="hs-identifier">Data.IntMap</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">IntMap</span></span><span>
</span><span id="line-107"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier">find</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier">intercalate</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-108"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier">Map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-110"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html"><span class="hs-identifier">GHC.Data.StringBuffer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.StringBuffer.html#stringToStringBuffer"><span class="hs-identifier">stringToStringBuffer</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-112"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#"><span class="hs-identifier">Control.Monad.Catch</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">MC</span></span><span>
</span><span id="line-113"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.html#"><span class="hs-identifier">Data.Array</span></a></span><span>
</span><span id="line-114"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Exception.html"><span class="hs-identifier">GHC.Utils.Exception</span></a></span><span>
</span><span id="line-115"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Unsafe.Coerce.html#"><span class="hs-identifier">Unsafe.Coerce</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce"><span class="hs-identifier">unsafeCoerce</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html"><span class="hs-identifier">GHC.Tc.Module</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html#runTcInteractive"><span class="hs-identifier">runTcInteractive</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html#tcRnType"><span class="hs-identifier">tcRnType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html#loadUnqualIfaces"><span class="hs-identifier">loadUnqualIfaces</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#ZonkFlexi"><span class="hs-identifier">ZonkFlexi</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#SkolemiseFlexi"><span class="hs-identifier">SkolemiseFlexi</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-119"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Utils.Env.html#tcGetInstEnvs"><span class="hs-identifier">tcGetInstEnvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html"><span class="hs-identifier">GHC.Tc.Utils.Instantiate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html#instDFunType"><span class="hs-identifier">instDFunType</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Solver.html"><span class="hs-identifier">GHC.Tc.Solver</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Solver.html#simplifyWantedsTcM"><span class="hs-identifier">simplifyWantedsTcM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-122"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-123"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Class.html"><span class="hs-identifier">GHC.Core.Class</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Class.html#classTyCon"><span class="hs-identifier">classTyCon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- running a statement interactively</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span id="local-6989586621681200797"><span class="annot"><a href="GHC.Runtime.Eval.html#getResumeContext"><span class="hs-identifier hs-type">getResumeContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200797"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200797"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#Resume"><span class="hs-identifier hs-type">Resume</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-129"></span><span id="getResumeContext"><span class="annot"><span class="annottext">getResumeContext :: forall (m :: * -&gt; *). GhcMonad m =&gt; m [Resume]
</span><a href="GHC.Runtime.Eval.html#getResumeContext"><span class="hs-identifier hs-var hs-var">getResumeContext</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [Resume]) -&gt; m [Resume]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Resume] -&gt; m [Resume]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([Resume] -&gt; m [Resume])
-&gt; (HscEnv -&gt; [Resume]) -&gt; HscEnv -&gt; m [Resume]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var hs-var">ic_resume</span></a></span><span> </span><span class="annot"><span class="annottext">(InteractiveContext -&gt; [Resume])
-&gt; (HscEnv -&gt; InteractiveContext) -&gt; HscEnv -&gt; [Resume]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="annot"><a href="GHC.Runtime.Eval.html#mkHistory"><span class="hs-identifier hs-type">mkHistory</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-type">BreakInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span>
</span><span id="line-132"></span><span id="mkHistory"><span class="annot"><span class="annottext">mkHistory :: HscEnv -&gt; ForeignHValue -&gt; BreakInfo -&gt; History
</span><a href="GHC.Runtime.Eval.html#mkHistory"><span class="hs-identifier hs-var hs-var">mkHistory</span></a></span></span><span> </span><span id="local-6989586621681200225"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200225"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681200224"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681200224"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681200223"><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681200223"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignHValue -&gt; BreakInfo -&gt; [String] -&gt; History
</span><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-var">History</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681200224"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681200223"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; BreakInfo -&gt; [String]
</span><a href="GHC.Runtime.Eval.html#findEnclosingDecls"><span class="hs-identifier hs-var">findEnclosingDecls</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200225"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681200223"><span class="hs-identifier hs-var">bi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="annot"><a href="GHC.Runtime.Eval.html#getHistoryModule"><span class="hs-identifier hs-type">getHistoryModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-135"></span><span id="getHistoryModule"><span class="annot"><span class="annottext">getHistoryModule :: History -&gt; Module
</span><a href="GHC.Runtime.Eval.html#getHistoryModule"><span class="hs-identifier hs-var hs-var">getHistoryModule</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BreakInfo -&gt; Module
</span><a href="GHC.Runtime.Eval.Types.html#breakInfo_module"><span class="hs-identifier hs-var hs-var">breakInfo_module</span></a></span><span> </span><span class="annot"><span class="annottext">(BreakInfo -&gt; Module)
-&gt; (History -&gt; BreakInfo) -&gt; History -&gt; Module
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">History -&gt; BreakInfo
</span><a href="GHC.Runtime.Eval.Types.html#historyBreakInfo"><span class="hs-identifier hs-var hs-var">historyBreakInfo</span></a></span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="annot"><a href="GHC.Runtime.Eval.html#getHistorySpan"><span class="hs-identifier hs-type">getHistorySpan</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>
</span><span id="line-138"></span><span id="getHistorySpan"><span class="annot"><span class="annottext">getHistorySpan :: HscEnv -&gt; History -&gt; SrcSpan
</span><a href="GHC.Runtime.Eval.html#getHistorySpan"><span class="hs-identifier hs-var hs-var">getHistorySpan</span></a></span></span><span> </span><span id="local-6989586621681200218"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200218"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span class="hs-special">{</span><span id="local-6989586621681200215"><span id="local-6989586621681200216"><span id="local-6989586621681200217"><span class="annot"><span class="annottext">[String]
ForeignHValue
BreakInfo
historyEnclosingDecls :: History -&gt; [String]
historyApStack :: History -&gt; ForeignHValue
historyEnclosingDecls :: [String]
historyBreakInfo :: BreakInfo
historyApStack :: ForeignHValue
historyBreakInfo :: History -&gt; BreakInfo
</span><a href="GHC.Runtime.Eval.Types.html#historyEnclosingDecls"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-type">BreakInfo</span></a></span><span class="hs-special">{</span><span id="local-6989586621681200210"><span id="local-6989586621681200211"><span class="annot"><span class="annottext">Int
Module
breakInfo_number :: BreakInfo -&gt; Int
breakInfo_number :: Int
breakInfo_module :: Module
breakInfo_module :: BreakInfo -&gt; Module
</span><a href="GHC.Runtime.Eval.Types.html#breakInfo_number"><span class="hs-glyph hs-var hs-var hs-var hs-var">..</span></a></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681200216"><span class="hs-identifier hs-var">historyBreakInfo</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-140"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200218"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681200211"><span class="hs-identifier hs-var">breakInfo_module</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-141"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681200205"><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681200205"><span class="hs-identifier hs-var">hmi</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ModBreaks -&gt; Array Int SrcSpan
</span><a href="GHC.ByteCode.Types.html#modBreaks_locs"><span class="hs-identifier hs-var hs-var">modBreaks_locs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModBreaks
</span><a href="GHC.Runtime.Interpreter.html#getModBreaks"><span class="hs-identifier hs-var">getModBreaks</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681200205"><span class="hs-identifier hs-var">hmi</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Array Int SrcSpan -&gt; Int -&gt; SrcSpan
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681200210"><span class="hs-identifier hs-var">breakInfo_number</span></a></span><span>
</span><span id="line-142"></span><span>    </span><span class="annot"><span class="annottext">Maybe HomeModInfo
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SrcSpan
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getHistorySpan&quot;</span></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-comment">{- | Finds the enclosing top level function name -}</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- ToDo: a better way to do this would be to keep hold of the decl_path computed</span><span>
</span><span id="line-146"></span><span class="hs-comment">-- by the coverage pass, which gives the list of lexically-enclosing bindings</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- for each tick.</span><span>
</span><span id="line-148"></span><span class="annot"><a href="GHC.Runtime.Eval.html#findEnclosingDecls"><span class="hs-identifier hs-type">findEnclosingDecls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-type">BreakInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-149"></span><span id="findEnclosingDecls"><span class="annot"><span class="annottext">findEnclosingDecls :: HscEnv -&gt; BreakInfo -&gt; [String]
</span><a href="GHC.Runtime.Eval.html#findEnclosingDecls"><span class="hs-identifier hs-var hs-var">findEnclosingDecls</span></a></span></span><span> </span><span id="local-6989586621681200201"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200201"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-type">BreakInfo</span></a></span><span> </span><span id="local-6989586621681200200"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681200200"><span class="hs-identifier hs-var">modl</span></a></span></span><span> </span><span id="local-6989586621681200199"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681200199"><span class="hs-identifier hs-var">ix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-150"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681200196"><span class="annot"><span class="annottext">hmi :: HomeModInfo
</span><a href="#local-6989586621681200196"><span class="hs-identifier hs-var hs-var">hmi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;findEnclosingDecls&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe HomeModInfo -&gt; HomeModInfo)
-&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-151"></span><span>             </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200201"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681200200"><span class="hs-identifier hs-var">modl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>       </span><span id="local-6989586621681200194"><span class="annot"><span class="annottext">mb :: ModBreaks
</span><a href="#local-6989586621681200194"><span class="hs-identifier hs-var hs-var">mb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModBreaks
</span><a href="GHC.Runtime.Interpreter.html#getModBreaks"><span class="hs-identifier hs-var">getModBreaks</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681200196"><span class="hs-identifier hs-var">hmi</span></a></span><span>
</span><span id="line-153"></span><span>   </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ModBreaks -&gt; Array Int [String]
</span><a href="GHC.ByteCode.Types.html#modBreaks_decls"><span class="hs-identifier hs-var hs-var">modBreaks_decls</span></a></span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="#local-6989586621681200194"><span class="hs-identifier hs-var">mb</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int [String] -&gt; Int -&gt; [String]
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681200199"><span class="hs-identifier hs-var">ix</span></a></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-comment">-- | Update fixity environment in the current interactive context.</span><span>
</span><span id="line-156"></span><span id="local-6989586621681200754"><span class="annot"><a href="GHC.Runtime.Eval.html#updateFixityEnv"><span class="hs-identifier hs-type">updateFixityEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200754"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FixityEnv"><span class="hs-identifier hs-type">FixityEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200754"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-157"></span><span id="updateFixityEnv"><span class="annot"><span class="annottext">updateFixityEnv :: forall (m :: * -&gt; *). GhcMonad m =&gt; FixityEnv -&gt; m ()
</span><a href="GHC.Runtime.Eval.html#updateFixityEnv"><span class="hs-identifier hs-var hs-var">updateFixityEnv</span></a></span></span><span> </span><span id="local-6989586621681200183"><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681200183"><span class="hs-identifier hs-var">fix_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-158"></span><span>  </span><span id="local-6989586621681200182"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200182"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681200180"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681200180"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200182"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-160"></span><span>  </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m ()) -&gt; HscEnv -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200182"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200180"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_fix_env :: FixityEnv
</span><a href="GHC.Driver.Types.html#ic_fix_env"><span class="hs-identifier hs-var">ic_fix_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681200183"><span class="hs-identifier hs-var">fix_env</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-163"></span><span class="hs-comment">-- execStmt</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="hs-comment">-- | default ExecOptions</span><span>
</span><span id="line-166"></span><span class="annot"><a href="GHC.Runtime.Eval.html#execOptions"><span class="hs-identifier hs-type">execOptions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier hs-type">ExecOptions</span></a></span><span>
</span><span id="line-167"></span><span id="execOptions"><span class="annot"><span class="annottext">execOptions :: ExecOptions
</span><a href="GHC.Runtime.Eval.html#execOptions"><span class="hs-identifier hs-var hs-var">execOptions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ExecOptions :: SingleStep
-&gt; String
-&gt; Int
-&gt; (ForeignHValue -&gt; EvalExpr ForeignHValue)
-&gt; ExecOptions
</span><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier hs-type">ExecOptions</span></a></span><span>
</span><span id="line-168"></span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">execSingleStep :: SingleStep
</span><a href="GHC.Runtime.Eval.Types.html#execSingleStep"><span class="hs-identifier hs-var">execSingleStep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="GHC.Runtime.Eval.Types.html#RunToCompletion"><span class="hs-identifier hs-var">RunToCompletion</span></a></span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">execSourceFile :: String
</span><a href="GHC.Runtime.Eval.Types.html#execSourceFile"><span class="hs-identifier hs-var">execSourceFile</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;interactive&gt;&quot;</span></span><span>
</span><span id="line-170"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">execLineNumber :: Int
</span><a href="GHC.Runtime.Eval.Types.html#execLineNumber"><span class="hs-identifier hs-var">execLineNumber</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-171"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">execWrap :: ForeignHValue -&gt; EvalExpr ForeignHValue
</span><a href="GHC.Runtime.Eval.Types.html#execWrap"><span class="hs-identifier hs-var">execWrap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignHValue -&gt; EvalExpr ForeignHValue
forall a. a -&gt; EvalExpr a
</span><a href="../../ghci/src/GHCi.Message.html#EvalThis"><span class="hs-identifier hs-var">EvalThis</span></a></span><span> </span><span class="hs-comment">-- just run the statement, don't wrap it in anything</span><span>
</span><span id="line-172"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-comment">-- | Run a statement in the current interactive context.</span><span>
</span><span id="line-175"></span><span id="local-6989586621681200747"><span class="annot"><a href="GHC.Runtime.Eval.html#execStmt"><span class="hs-identifier hs-type">execStmt</span></a></span><span>
</span><span id="line-176"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200747"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-177"></span><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>             </span><span class="hs-comment">-- ^ a statement (bind or expression)</span><span>
</span><span id="line-178"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier hs-type">ExecOptions</span></a></span><span>
</span><span id="line-179"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200747"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecResult"><span class="hs-identifier hs-type">ExecResult</span></a></span></span><span>
</span><span id="line-180"></span><span id="execStmt"><span class="annot"><span class="annottext">execStmt :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
String -&gt; ExecOptions -&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#execStmt"><span class="hs-identifier hs-var hs-var">execStmt</span></a></span></span><span> </span><span id="local-6989586621681200155"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200155"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span id="local-6989586621681200154"><span class="annot"><span class="annottext">exec_opts :: ExecOptions
</span><a href="#local-6989586621681200154"><span class="hs-identifier hs-var">exec_opts</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier hs-type">ExecOptions</span></a></span><span class="hs-special">{</span><span id="local-6989586621681200150"><span id="local-6989586621681200151"><span id="local-6989586621681200152"><span id="local-6989586621681200153"><span class="annot"><span class="annottext">Int
String
SingleStep
ForeignHValue -&gt; EvalExpr ForeignHValue
execWrap :: ForeignHValue -&gt; EvalExpr ForeignHValue
execLineNumber :: Int
execSourceFile :: String
execSingleStep :: SingleStep
execWrap :: ExecOptions -&gt; ForeignHValue -&gt; EvalExpr ForeignHValue
execLineNumber :: ExecOptions -&gt; Int
execSourceFile :: ExecOptions -&gt; String
execSingleStep :: ExecOptions -&gt; SingleStep
</span><a href="#local-6989586621681200150"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-181"></span><span>    </span><span id="local-6989586621681200149"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200149"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span>    </span><span id="local-6989586621681200148"><span class="annot"><span class="annottext">Maybe (GhciLStmt GhcPs)
</span><a href="#local-6989586621681200148"><span class="hs-identifier hs-var">mb_stmt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-184"></span><span>      </span><span class="annot"><span class="annottext">IO (Maybe (GhciLStmt GhcPs)) -&gt; m (Maybe (GhciLStmt GhcPs))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe (GhciLStmt GhcPs)) -&gt; m (Maybe (GhciLStmt GhcPs)))
-&gt; IO (Maybe (GhciLStmt GhcPs)) -&gt; m (Maybe (GhciLStmt GhcPs))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-185"></span><span>      </span><span class="annot"><span class="annottext">HscEnv
-&gt; Hsc (Maybe (GhciLStmt GhcPs)) -&gt; IO (Maybe (GhciLStmt GhcPs))
forall a. HscEnv -&gt; Hsc a -&gt; IO a
</span><a href="GHC.Driver.Types.html#runInteractiveHsc"><span class="hs-identifier hs-var">runInteractiveHsc</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200149"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(Hsc (Maybe (GhciLStmt GhcPs)) -&gt; IO (Maybe (GhciLStmt GhcPs)))
-&gt; Hsc (Maybe (GhciLStmt GhcPs)) -&gt; IO (Maybe (GhciLStmt GhcPs))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-186"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; Int -&gt; String -&gt; Hsc (Maybe (GhciLStmt GhcPs))
</span><a href="GHC.Driver.Main.html#hscParseStmtWithLocation"><span class="hs-identifier hs-var">hscParseStmtWithLocation</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200152"><span class="hs-identifier hs-var">execSourceFile</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681200151"><span class="hs-identifier hs-var">execLineNumber</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200155"><span class="hs-identifier hs-var">input</span></a></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (GhciLStmt GhcPs)
</span><a href="#local-6989586621681200148"><span class="hs-identifier hs-var">mb_stmt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-189"></span><span>      </span><span class="hs-comment">-- empty statement / comment</span><span>
</span><span id="line-190"></span><span>      </span><span class="annot"><span class="annottext">Maybe (GhciLStmt GhcPs)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExecResult -&gt; m ExecResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either SomeException [Name] -&gt; Word64 -&gt; ExecResult
</span><a href="GHC.Runtime.Eval.Types.html#ExecComplete"><span class="hs-identifier hs-var">ExecComplete</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Either SomeException [Name]
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681200143"><span class="annot"><span class="annottext">GhciLStmt GhcPs
</span><a href="#local-6989586621681200143"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GhciLStmt GhcPs -&gt; String -&gt; ExecOptions -&gt; m ExecResult
forall (m :: * -&gt; *).
GhcMonad m =&gt;
GhciLStmt GhcPs -&gt; String -&gt; ExecOptions -&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#execStmt%27"><span class="hs-identifier hs-var">execStmt'</span></a></span><span> </span><span class="annot"><span class="annottext">GhciLStmt GhcPs
</span><a href="#local-6989586621681200143"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200155"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="annot"><span class="annottext">ExecOptions
</span><a href="#local-6989586621681200154"><span class="hs-identifier hs-var">exec_opts</span></a></span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="hs-comment">-- | Like `execStmt`, but takes a parsed statement as argument. Useful when</span><span>
</span><span id="line-194"></span><span class="hs-comment">-- doing preprocessing on the AST before execution, e.g. in GHCi (see</span><span>
</span><span id="line-195"></span><span class="hs-comment">-- GHCi.UI.runStmt).</span><span>
</span><span id="line-196"></span><span id="local-6989586621681200732"><span class="annot"><a href="GHC.Runtime.Eval.html#execStmt%27"><span class="hs-identifier hs-type">execStmt'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200732"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GhciLStmt"><span class="hs-identifier hs-type">GhciLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier hs-type">ExecOptions</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200732"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecResult"><span class="hs-identifier hs-type">ExecResult</span></a></span></span><span>
</span><span id="line-197"></span><span id="execStmt%27"><span class="annot"><span class="annottext">execStmt' :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
GhciLStmt GhcPs -&gt; String -&gt; ExecOptions -&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#execStmt%27"><span class="hs-identifier hs-var hs-var">execStmt'</span></a></span></span><span> </span><span id="local-6989586621681200124"><span class="annot"><span class="annottext">GhciLStmt GhcPs
</span><a href="#local-6989586621681200124"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span id="local-6989586621681200123"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200123"><span class="hs-identifier hs-var">stmt_text</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecOptions"><span class="hs-identifier hs-type">ExecOptions</span></a></span><span class="hs-special">{</span><span id="local-6989586621681200119"><span id="local-6989586621681200120"><span id="local-6989586621681200121"><span id="local-6989586621681200122"><span class="annot"><span class="annottext">Int
String
SingleStep
ForeignHValue -&gt; EvalExpr ForeignHValue
execWrap :: ForeignHValue -&gt; EvalExpr ForeignHValue
execLineNumber :: Int
execSourceFile :: String
execSingleStep :: SingleStep
execWrap :: ExecOptions -&gt; ForeignHValue -&gt; EvalExpr ForeignHValue
execLineNumber :: ExecOptions -&gt; Int
execSourceFile :: ExecOptions -&gt; String
execSingleStep :: ExecOptions -&gt; SingleStep
</span><a href="#local-6989586621681200119"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-198"></span><span>    </span><span id="local-6989586621681200118"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200118"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span>    </span><span class="hs-comment">-- Turn off -fwarn-unused-local-binds when running a statement, to hide</span><span>
</span><span id="line-201"></span><span>    </span><span class="hs-comment">-- warnings about the implicit bindings we introduce.</span><span>
</span><span id="line-202"></span><span>    </span><span class="hs-comment">-- (This is basically `mkInteractiveHscEnv hsc_env`, except we unset</span><span>
</span><span id="line-203"></span><span>    </span><span class="hs-comment">-- -wwarn-unused-local-binds)</span><span>
</span><span id="line-204"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681200117"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681200117"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200118"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-comment">-- use the interactive dflags</span><span>
</span><span id="line-205"></span><span>        </span><span id="local-6989586621681200116"><span class="annot"><span class="annottext">idflags' :: DynFlags
</span><a href="#local-6989586621681200116"><span class="hs-identifier hs-var hs-var">idflags'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#ic_dflags"><span class="hs-identifier hs-var hs-var">ic_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200117"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; WarningFlag -&gt; DynFlags
</span><a href="GHC.Driver.Session.html#wopt_unset"><span class="hs-operator hs-var">`wopt_unset`</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedLocalBinds"><span class="hs-identifier hs-var">Opt_WarnUnusedLocalBinds</span></a></span><span>
</span><span id="line-206"></span><span>        </span><span id="local-6989586621681200112"><span class="annot"><span class="annottext">hsc_env' :: HscEnv
</span><a href="#local-6989586621681200112"><span class="hs-identifier hs-var hs-var">hsc_env'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; HscEnv
</span><a href="GHC.Driver.Types.html#mkInteractiveHscEnv"><span class="hs-identifier hs-var">mkInteractiveHscEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200118"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200117"><span class="hs-identifier hs-var">ic</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#ic_dflags"><span class="hs-identifier hs-var">ic_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681200116"><span class="hs-identifier hs-var">idflags'</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span>    </span><span id="local-6989586621681200110"><span class="annot"><span class="annottext">Maybe ([Id], ForeignHValue, FixityEnv)
</span><a href="#local-6989586621681200110"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe ([Id], ForeignHValue, FixityEnv))
-&gt; m (Maybe ([Id], ForeignHValue, FixityEnv))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe ([Id], ForeignHValue, FixityEnv))
 -&gt; m (Maybe ([Id], ForeignHValue, FixityEnv)))
-&gt; IO (Maybe ([Id], ForeignHValue, FixityEnv))
-&gt; m (Maybe ([Id], ForeignHValue, FixityEnv))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; GhciLStmt GhcPs -&gt; IO (Maybe ([Id], ForeignHValue, FixityEnv))
</span><a href="GHC.Driver.Main.html#hscParsedStmt"><span class="hs-identifier hs-var">hscParsedStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200112"><span class="hs-identifier hs-var">hsc_env'</span></a></span><span> </span><span class="annot"><span class="annottext">GhciLStmt GhcPs
</span><a href="#local-6989586621681200124"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ([Id], ForeignHValue, FixityEnv)
</span><a href="#local-6989586621681200110"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-211"></span><span>      </span><span class="annot"><span class="annottext">Maybe ([Id], ForeignHValue, FixityEnv)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-212"></span><span>        </span><span class="hs-comment">-- empty statement / comment</span><span>
</span><span id="line-213"></span><span>        </span><span class="annot"><span class="annottext">ExecResult -&gt; m ExecResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either SomeException [Name] -&gt; Word64 -&gt; ExecResult
</span><a href="GHC.Runtime.Eval.Types.html#ExecComplete"><span class="hs-identifier hs-var">ExecComplete</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Either SomeException [Name]
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681200108"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681200108"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681200107"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681200107"><span class="hs-identifier hs-var">hval</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681200106"><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681200106"><span class="hs-identifier hs-var">fix_env</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-215"></span><span>        </span><span class="annot"><span class="annottext">FixityEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; FixityEnv -&gt; m ()
</span><a href="GHC.Runtime.Eval.html#updateFixityEnv"><span class="hs-identifier hs-var">updateFixityEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681200106"><span class="hs-identifier hs-var">fix_env</span></a></span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span>        </span><span id="local-6989586621681200105"><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681200105"><span class="hs-identifier hs-var">status</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-218"></span><span>          </span><span class="annot"><span class="annottext">m (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall (m :: * -&gt; *) a. GhcMonad m =&gt; m a -&gt; m a
</span><a href="GHC.Runtime.Eval.html#withVirtualCWD"><span class="hs-identifier hs-var">withVirtualCWD</span></a></span><span> </span><span class="annot"><span class="annottext">(m (EvalStatus_ [ForeignHValue] [HValueRef])
 -&gt; m (EvalStatus_ [ForeignHValue] [HValueRef]))
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-219"></span><span>            </span><span class="annot"><span class="annottext">IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (EvalStatus_ [ForeignHValue] [HValueRef])
 -&gt; m (EvalStatus_ [ForeignHValue] [HValueRef]))
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-220"></span><span>              </span><span class="annot"><span class="annottext">HscEnv
-&gt; Bool
-&gt; EvalExpr ForeignHValue
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
</span><a href="GHC.Runtime.Interpreter.html#evalStmt"><span class="hs-identifier hs-var">evalStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200112"><span class="hs-identifier hs-var">hsc_env'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SingleStep -&gt; Bool
</span><a href="GHC.Runtime.Eval.Types.html#isStep"><span class="hs-identifier hs-var">isStep</span></a></span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="#local-6989586621681200122"><span class="hs-identifier hs-var">execSingleStep</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ForeignHValue -&gt; EvalExpr ForeignHValue
</span><a href="#local-6989586621681200119"><span class="hs-identifier hs-var">execWrap</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681200107"><span class="hs-identifier hs-var">hval</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681200101"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681200101"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200118"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-223"></span><span>            </span><span id="local-6989586621681200100"><span class="annot"><span class="annottext">bindings :: ([TyThing], GlobalRdrEnv)
</span><a href="#local-6989586621681200100"><span class="hs-identifier hs-var hs-var">bindings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InteractiveContext -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#ic_tythings"><span class="hs-identifier hs-var hs-var">ic_tythings</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200101"><span class="hs-identifier hs-var">ic</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#ic_rn_gbl_env"><span class="hs-identifier hs-var hs-var">ic_rn_gbl_env</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200101"><span class="hs-identifier hs-var">ic</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span>            </span><span id="local-6989586621681200097"><span class="annot"><span class="annottext">size :: Int
</span><a href="#local-6989586621681200097"><span class="hs-identifier hs-var hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#ghciHistSize"><span class="hs-identifier hs-var hs-var">ghciHistSize</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681200116"><span class="hs-identifier hs-var">idflags'</span></a></span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span>        </span><span class="annot"><span class="annottext">SingleStep
-&gt; String
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; EvalStatus_ [ForeignHValue] [HValueRef]
-&gt; BoundedList History
-&gt; m ExecResult
forall (m :: * -&gt; *).
GhcMonad m =&gt;
SingleStep
-&gt; String
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; EvalStatus_ [ForeignHValue] [HValueRef]
-&gt; BoundedList History
-&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#handleRunStatus"><span class="hs-identifier hs-var">handleRunStatus</span></a></span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="#local-6989586621681200122"><span class="hs-identifier hs-var">execSingleStep</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200123"><span class="hs-identifier hs-var">stmt_text</span></a></span><span> </span><span class="annot"><span class="annottext">([TyThing], GlobalRdrEnv)
</span><a href="#local-6989586621681200100"><span class="hs-identifier hs-var">bindings</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681200108"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-228"></span><span>                        </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681200105"><span class="hs-identifier hs-var">status</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; BoundedList History
</span><a href="GHC.Runtime.Eval.html#emptyHistory"><span class="hs-identifier hs-var">emptyHistory</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681200097"><span class="hs-identifier hs-var">size</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span id="local-6989586621681200720"><span class="annot"><a href="GHC.Runtime.Eval.html#runDecls"><span class="hs-identifier hs-type">runDecls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200720"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200720"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-231"></span><span id="runDecls"><span class="annot"><span class="annottext">runDecls :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#runDecls"><span class="hs-identifier hs-var hs-var">runDecls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int -&gt; String -&gt; m [Name]
forall (m :: * -&gt; *).
GhcMonad m =&gt;
String -&gt; Int -&gt; String -&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#runDeclsWithLocation"><span class="hs-identifier hs-var">runDeclsWithLocation</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;interactive&gt;&quot;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span class="hs-comment">-- | Run some declarations and return any user-visible names that were brought</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- into scope.</span><span>
</span><span id="line-235"></span><span id="local-6989586621681200718"><span class="annot"><a href="GHC.Runtime.Eval.html#runDeclsWithLocation"><span class="hs-identifier hs-type">runDeclsWithLocation</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200718"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200718"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-236"></span><span id="runDeclsWithLocation"><span class="annot"><span class="annottext">runDeclsWithLocation :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
String -&gt; Int -&gt; String -&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#runDeclsWithLocation"><span class="hs-identifier hs-var hs-var">runDeclsWithLocation</span></a></span></span><span> </span><span id="local-6989586621681200080"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200080"><span class="hs-identifier hs-var">source</span></a></span></span><span> </span><span id="local-6989586621681200079"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681200079"><span class="hs-identifier hs-var">line_num</span></a></span></span><span> </span><span id="local-6989586621681200078"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200078"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-237"></span><span>    </span><span id="local-6989586621681200077"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200077"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-238"></span><span>    </span><span id="local-6989586621681200076"><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681200076"><span class="hs-identifier hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO [LHsDecl GhcPs] -&gt; m [LHsDecl GhcPs]
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; String -&gt; Int -&gt; String -&gt; IO [LHsDecl GhcPs]
</span><a href="GHC.Driver.Main.html#hscParseDeclsWithLocation"><span class="hs-identifier hs-var">hscParseDeclsWithLocation</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200077"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200080"><span class="hs-identifier hs-var">source</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681200079"><span class="hs-identifier hs-var">line_num</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200078"><span class="hs-identifier hs-var">input</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-239"></span><span>    </span><span class="annot"><span class="annottext">[LHsDecl GhcPs] -&gt; m [Name]
forall (m :: * -&gt; *). GhcMonad m =&gt; [LHsDecl GhcPs] -&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#runParsedDecls"><span class="hs-identifier hs-var">runParsedDecls</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681200076"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="hs-comment">-- | Like `runDeclsWithLocation`, but takes parsed declarations as argument.</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- Useful when doing preprocessing on the AST before execution, e.g. in GHCi</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- (see GHCi.UI.runStmt).</span><span>
</span><span id="line-244"></span><span id="local-6989586621681200715"><span class="annot"><a href="GHC.Runtime.Eval.html#runParsedDecls"><span class="hs-identifier hs-type">runParsedDecls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200715"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Decls.html#LHsDecl"><span class="hs-identifier hs-type">LHsDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200715"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-245"></span><span id="runParsedDecls"><span class="annot"><span class="annottext">runParsedDecls :: forall (m :: * -&gt; *). GhcMonad m =&gt; [LHsDecl GhcPs] -&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#runParsedDecls"><span class="hs-identifier hs-var hs-var">runParsedDecls</span></a></span></span><span> </span><span id="local-6989586621681200053"><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681200053"><span class="hs-identifier hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-246"></span><span>    </span><span id="local-6989586621681200052"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200052"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-247"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681200051"><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681200051"><span class="hs-identifier hs-var">tyThings</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681200050"><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200050"><span class="hs-identifier hs-var">ic</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ([TyThing], InteractiveContext)
-&gt; m ([TyThing], InteractiveContext)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; [LHsDecl GhcPs] -&gt; IO ([TyThing], InteractiveContext)
</span><a href="GHC.Driver.Main.html#hscParsedDecls"><span class="hs-identifier hs-var">hscParsedDecls</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200052"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681200053"><span class="hs-identifier hs-var">decls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span>    </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m ()) -&gt; HscEnv -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200052"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200050"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-250"></span><span>    </span><span id="local-6989586621681200048"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200048"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-251"></span><span>    </span><span id="local-6989586621681200047"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200047"><span class="hs-identifier hs-var">hsc_env'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO HscEnv -&gt; m HscEnv
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO HscEnv -&gt; m HscEnv) -&gt; IO HscEnv -&gt; m HscEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
</span><a href="GHC.Runtime.Eval.html#rttiEnvironment"><span class="hs-identifier hs-var">rttiEnvironment</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200048"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-252"></span><span>    </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200047"><span class="hs-identifier hs-var">hsc_env'</span></a></span><span>
</span><span id="line-253"></span><span>    </span><span class="annot"><span class="annottext">[Name] -&gt; m [Name]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([Name] -&gt; m [Name]) -&gt; [Name] -&gt; m [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; [Name] -&gt; [Name]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (Name -&gt; Bool) -&gt; Name -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#isDerivedOccName"><span class="hs-identifier hs-var">isDerivedOccName</span></a></span><span> </span><span class="annot"><span class="annottext">(OccName -&gt; Bool) -&gt; (Name -&gt; OccName) -&gt; Name -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span>             </span><span class="hs-comment">-- For this filter, see Note [What to show to users]</span><span>
</span><span id="line-255"></span><span>           </span><span class="annot"><span class="annottext">([Name] -&gt; [Name]) -&gt; [Name] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(TyThing -&gt; Name) -&gt; [TyThing] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TyThing -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681200051"><span class="hs-identifier hs-var">tyThings</span></a></span><span>
</span><span id="line-256"></span><span>
</span><span id="line-257"></span><span class="hs-comment">{- Note [What to show to users]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We don't want to display internally-generated bindings to users.
Things like the coercion axiom for newtypes. These bindings all get
OccNames that users can't write, to avoid the possibility of name
clashes (in linker symbols).  That gives a convenient way to suppress
them. The relevant predicate is OccName.isDerivedOccName.
See #11051 for more background and examples.
-}</span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span id="local-6989586621681200725"><span id="local-6989586621681200726"><span class="annot"><a href="GHC.Runtime.Eval.html#withVirtualCWD"><span class="hs-identifier hs-type">withVirtualCWD</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200725"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200726"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200725"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-268"></span><span id="withVirtualCWD"><span class="annot"><span class="annottext">withVirtualCWD :: forall (m :: * -&gt; *) a. GhcMonad m =&gt; m a -&gt; m a
</span><a href="GHC.Runtime.Eval.html#withVirtualCWD"><span class="hs-identifier hs-var hs-var">withVirtualCWD</span></a></span></span><span> </span><span id="local-6989586621681200029"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681200029"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-269"></span><span>  </span><span id="local-6989586621681200028"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200028"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span>    </span><span class="hs-comment">-- a virtual CWD is only necessary when we're running interpreted code in</span><span>
</span><span id="line-272"></span><span>    </span><span class="hs-comment">-- the same process as the compiler.</span><span>
</span><span id="line-273"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Maybe Interp
</span><a href="GHC.Driver.Types.html#hsc_interp"><span class="hs-identifier hs-var hs-var">hsc_interp</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200028"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-274"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Interpreter.Types.html#ExternalInterp"><span class="hs-identifier hs-type">ExternalInterp</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681200029"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-275"></span><span>    </span><span class="annot"><span class="annottext">Maybe Interp
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-276"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681200025"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681200025"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681200028"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-277"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681200018"><span class="annot"><span class="annottext">set_cwd :: m String
</span><a href="#local-6989586621681200018"><span class="hs-identifier hs-var hs-var">set_cwd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-278"></span><span>            </span><span id="local-6989586621681200017"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200017"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO String -&gt; m String
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO String -&gt; m String) -&gt; IO String -&gt; m String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="../../directory/src/System.Directory.html#getCurrentDirectory"><span class="hs-identifier hs-var">getCurrentDirectory</span></a></span><span>
</span><span id="line-279"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; Maybe String
</span><a href="GHC.Driver.Types.html#ic_cwd"><span class="hs-identifier hs-var hs-var">ic_cwd</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681200025"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-280"></span><span>               </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681200014"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200014"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#setCurrentDirectory"><span class="hs-identifier hs-var">setCurrentDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200014"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-281"></span><span>               </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span>            </span><span class="annot"><span class="annottext">String -&gt; m String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681200017"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span>          </span><span id="local-6989586621681199999"><span class="annot"><span class="annottext">reset_cwd :: String -&gt; m ()
</span><a href="#local-6989586621681199999"><span class="hs-identifier hs-var hs-var">reset_cwd</span></a></span></span><span> </span><span id="local-6989586621681199998"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199998"><span class="hs-identifier hs-var">orig_dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-285"></span><span>            </span><span id="local-6989586621681199997"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199997"><span class="hs-identifier hs-var">virt_dir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO String -&gt; m String
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO String -&gt; m String) -&gt; IO String -&gt; m String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="../../directory/src/System.Directory.html#getCurrentDirectory"><span class="hs-identifier hs-var">getCurrentDirectory</span></a></span><span>
</span><span id="line-286"></span><span>            </span><span id="local-6989586621681199996"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199996"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-287"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199995"><span class="annot"><span class="annottext">old_IC :: InteractiveContext
</span><a href="#local-6989586621681199995"><span class="hs-identifier hs-var hs-var">old_IC</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199996"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-288"></span><span>            </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199996"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span>  </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199995"><span class="hs-identifier hs-var">old_IC</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_cwd :: Maybe String
</span><a href="GHC.Driver.Types.html#ic_cwd"><span class="hs-identifier hs-var">ic_cwd</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199997"><span class="hs-identifier hs-var">virt_dir</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-289"></span><span>            </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#setCurrentDirectory"><span class="hs-identifier hs-var">setCurrentDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199998"><span class="hs-identifier hs-var">orig_dir</span></a></span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span>      </span><span class="annot"><span class="annottext">m String -&gt; (String -&gt; m ()) -&gt; (String -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) a c b.
MonadMask m =&gt;
m a -&gt; (a -&gt; m c) -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../exceptions/src/Control.Monad.Catch.html#bracket"><span class="hs-identifier hs-var">MC.bracket</span></a></span><span> </span><span class="annot"><span class="annottext">m String
</span><a href="#local-6989586621681200018"><span class="hs-identifier hs-var">set_cwd</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; m ()
forall {m :: * -&gt; *}. GhcMonad m =&gt; String -&gt; m ()
</span><a href="#local-6989586621681199999"><span class="hs-identifier hs-var">reset_cwd</span></a></span><span> </span><span class="annot"><span class="annottext">((String -&gt; m a) -&gt; m a) -&gt; (String -&gt; m a) -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681200029"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span id="local-6989586621681200699"><span class="annot"><a href="GHC.Runtime.Eval.html#parseImportDecl"><span class="hs-identifier hs-type">parseImportDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200699"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200699"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#ImportDecl"><span class="hs-identifier hs-type">ImportDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-294"></span><span id="parseImportDecl"><span class="annot"><span class="annottext">parseImportDecl :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m (ImportDecl GhcPs)
</span><a href="GHC.Runtime.Eval.html#parseImportDecl"><span class="hs-identifier hs-var hs-var">parseImportDecl</span></a></span></span><span> </span><span id="local-6989586621681199988"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199988"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (ImportDecl GhcPs)) -&gt; m (ImportDecl GhcPs)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (ImportDecl GhcPs)) -&gt; m (ImportDecl GhcPs))
-&gt; (HscEnv -&gt; m (ImportDecl GhcPs)) -&gt; m (ImportDecl GhcPs)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199987"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199987"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO (ImportDecl GhcPs) -&gt; m (ImportDecl GhcPs)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (ImportDecl GhcPs) -&gt; m (ImportDecl GhcPs))
-&gt; IO (ImportDecl GhcPs) -&gt; m (ImportDecl GhcPs)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; String -&gt; IO (ImportDecl GhcPs)
</span><a href="GHC.Driver.Main.html#hscImport"><span class="hs-identifier hs-var">hscImport</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199987"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199988"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span class="annot"><a href="GHC.Runtime.Eval.html#emptyHistory"><span class="hs-identifier hs-type">emptyHistory</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-type">BoundedList</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span>
</span><span id="line-297"></span><span id="emptyHistory"><span class="annot"><span class="annottext">emptyHistory :: Int -&gt; BoundedList History
</span><a href="GHC.Runtime.Eval.html#emptyHistory"><span class="hs-identifier hs-var hs-var">emptyHistory</span></a></span></span><span> </span><span id="local-6989586621681199985"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199985"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; BoundedList History
forall a. Int -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#nilBL"><span class="hs-identifier hs-var">nilBL</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199985"><span class="hs-identifier hs-var">size</span></a></span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span id="local-6989586621681200721"><span class="annot"><a href="GHC.Runtime.Eval.html#handleRunStatus"><span class="hs-identifier hs-type">handleRunStatus</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200721"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-300"></span><span>                </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#SingleStep"><span class="hs-identifier hs-type">SingleStep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-301"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalStatus_"><span class="hs-identifier hs-type">EvalStatus_</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#HValueRef"><span class="hs-identifier hs-type">HValueRef</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-302"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-type">BoundedList</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span>
</span><span id="line-303"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200721"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecResult"><span class="hs-identifier hs-type">ExecResult</span></a></span></span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span id="handleRunStatus"><span class="annot"><span class="annottext">handleRunStatus :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
SingleStep
-&gt; String
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; EvalStatus_ [ForeignHValue] [HValueRef]
-&gt; BoundedList History
-&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#handleRunStatus"><span class="hs-identifier hs-var hs-var">handleRunStatus</span></a></span></span><span> </span><span id="local-6989586621681199977"><span class="annot"><span class="annottext">SingleStep
</span><a href="#local-6989586621681199977"><span class="hs-identifier hs-var">step</span></a></span></span><span> </span><span id="local-6989586621681199976"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199976"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span id="local-6989586621681199975"><span class="annot"><span class="annottext">([TyThing], GlobalRdrEnv)
</span><a href="#local-6989586621681199975"><span class="hs-identifier hs-var">bindings</span></a></span></span><span> </span><span id="local-6989586621681199974"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199974"><span class="hs-identifier hs-var">final_ids</span></a></span></span><span> </span><span id="local-6989586621681199973"><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199973"><span class="hs-identifier hs-var">status</span></a></span></span><span> </span><span id="local-6989586621681199972"><span class="annot"><span class="annottext">BoundedList History
</span><a href="#local-6989586621681199972"><span class="hs-identifier hs-var">history</span></a></span></span><span>
</span><span id="line-306"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="GHC.Runtime.Eval.Types.html#RunAndLogSteps"><span class="hs-identifier hs-var">RunAndLogSteps</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="#local-6989586621681199977"><span class="hs-identifier hs-var">step</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m ExecResult
</span><a href="#local-6989586621681199970"><span class="hs-identifier hs-var">tracing</span></a></span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m ExecResult
</span><a href="#local-6989586621681199969"><span class="hs-identifier hs-var">not_tracing</span></a></span><span>
</span><span id="line-308"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-309"></span><span>  </span><span id="local-6989586621681199970"><span class="annot"><span class="annottext">tracing :: m ExecResult
</span><a href="#local-6989586621681199970"><span class="hs-identifier hs-var hs-var">tracing</span></a></span></span><span>
</span><span id="line-310"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalBreak"><span class="hs-identifier hs-type">EvalBreak</span></a></span><span> </span><span id="local-6989586621681199956"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199956"><span class="hs-identifier hs-var">is_exception</span></a></span></span><span> </span><span id="local-6989586621681199955"><span class="annot"><span class="annottext">HValueRef
</span><a href="#local-6989586621681199955"><span class="hs-identifier hs-var">apStack_ref</span></a></span></span><span> </span><span id="local-6989586621681199954"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199954"><span class="hs-identifier hs-var">ix</span></a></span></span><span> </span><span id="local-6989586621681199953"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199953"><span class="hs-identifier hs-var">mod_uniq</span></a></span></span><span> </span><span id="local-6989586621681199952"><span class="annot"><span class="annottext">RemoteRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199952"><span class="hs-identifier hs-var">resume_ctxt</span></a></span></span><span> </span><span id="local-6989586621681199951"><span class="annot"><span class="annottext">RemotePtr CostCentreStack
</span><a href="#local-6989586621681199951"><span class="hs-identifier hs-var">_ccs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199973"><span class="hs-identifier hs-var">status</span></a></span><span>
</span><span id="line-311"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199956"><span class="hs-identifier hs-var">is_exception</span></a></span><span>
</span><span id="line-312"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-313"></span><span>       </span><span id="local-6989586621681199950"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199950"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-314"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199947"><span class="annot"><span class="annottext">hmi :: HomeModInfo
</span><a href="#local-6989586621681199947"><span class="hs-identifier hs-var hs-var">hmi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;handleRunStatus&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe HomeModInfo -&gt; HomeModInfo)
-&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-315"></span><span>                   </span><span class="annot"><span class="annottext">HomePackageTable -&gt; Unique -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHptDirectly"><span class="hs-identifier hs-var">lookupHptDirectly</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199950"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-316"></span><span>                                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Unique
</span><a href="GHC.Types.Unique.html#mkUniqueGrimily"><span class="hs-identifier hs-var">mkUniqueGrimily</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199953"><span class="hs-identifier hs-var">mod_uniq</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-317"></span><span>           </span><span id="local-6989586621681199944"><span class="annot"><span class="annottext">modl :: Module
</span><a href="#local-6989586621681199944"><span class="hs-identifier hs-var hs-var">modl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModIface_ 'ModIfaceFinal -&gt; Module
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; Module
</span><a href="GHC.Driver.Types.html#mi_module"><span class="hs-identifier hs-var hs-var">mi_module</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface_ 'ModIfaceFinal
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199947"><span class="hs-identifier hs-var">hmi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-318"></span><span>           </span><span id="local-6989586621681199941"><span class="annot"><span class="annottext">breaks :: ModBreaks
</span><a href="#local-6989586621681199941"><span class="hs-identifier hs-var hs-var">breaks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModBreaks
</span><a href="GHC.Runtime.Interpreter.html#getModBreaks"><span class="hs-identifier hs-var">getModBreaks</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199947"><span class="hs-identifier hs-var">hmi</span></a></span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span>       </span><span id="local-6989586621681199940"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199940"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Bool -&gt; m Bool
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Bool -&gt; m Bool) -&gt; IO Bool -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-321"></span><span>              </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignRef BreakArray -&gt; Int -&gt; IO Bool
</span><a href="GHC.Runtime.Interpreter.html#breakpointStatus"><span class="hs-identifier hs-var">breakpointStatus</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199950"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModBreaks -&gt; ForeignRef BreakArray
</span><a href="GHC.ByteCode.Types.html#modBreaks_flags"><span class="hs-identifier hs-var hs-var">modBreaks_flags</span></a></span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="#local-6989586621681199941"><span class="hs-identifier hs-var">breaks</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199954"><span class="hs-identifier hs-var">ix</span></a></span><span>
</span><span id="line-322"></span><span>       </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199940"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-323"></span><span>         </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">m ExecResult
</span><a href="#local-6989586621681199969"><span class="hs-identifier hs-var">not_tracing</span></a></span><span>
</span><span id="line-324"></span><span>           </span><span class="hs-comment">-- This breakpoint is explicitly enabled; we want to stop</span><span>
</span><span id="line-325"></span><span>           </span><span class="hs-comment">-- instead of just logging it.</span><span>
</span><span id="line-326"></span><span>         </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-327"></span><span>           </span><span id="local-6989586621681199937"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199937"><span class="hs-identifier hs-var">apStack_fhv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ForeignHValue -&gt; m ForeignHValue
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ForeignHValue -&gt; m ForeignHValue)
-&gt; IO ForeignHValue -&gt; m ForeignHValue
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; HValueRef -&gt; IO ForeignHValue
forall a. HscEnv -&gt; RemoteRef a -&gt; IO (ForeignRef a)
</span><a href="GHC.Runtime.Interpreter.html#mkFinalizedHValue"><span class="hs-identifier hs-var">mkFinalizedHValue</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199950"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">HValueRef
</span><a href="#local-6989586621681199955"><span class="hs-identifier hs-var">apStack_ref</span></a></span><span>
</span><span id="line-328"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199935"><span class="annot"><span class="annottext">bi :: BreakInfo
</span><a href="#local-6989586621681199935"><span class="hs-identifier hs-var hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; Int -&gt; BreakInfo
</span><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-var">BreakInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199944"><span class="hs-identifier hs-var">modl</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199954"><span class="hs-identifier hs-var">ix</span></a></span><span>
</span><span id="line-329"></span><span>               </span><span class="hs-glyph">!</span><span id="local-6989586621681199934"><span class="annot"><span class="annottext">history' :: BoundedList History
</span><a href="#local-6989586621681199934"><span class="hs-identifier hs-var hs-var">history'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; BreakInfo -&gt; History
</span><a href="GHC.Runtime.Eval.html#mkHistory"><span class="hs-identifier hs-var">mkHistory</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199950"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199937"><span class="hs-identifier hs-var">apStack_fhv</span></a></span><span> </span><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681199935"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">History -&gt; BoundedList History -&gt; BoundedList History
forall a. a -&gt; BoundedList a -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#consBL"><span class="hs-operator hs-var">`consBL`</span></a></span><span> </span><span class="annot"><span class="annottext">BoundedList History
</span><a href="#local-6989586621681199972"><span class="hs-identifier hs-var">history</span></a></span><span>
</span><span id="line-330"></span><span>                 </span><span class="hs-comment">-- history is strict, otherwise our BoundedList is pointless.</span><span>
</span><span id="line-331"></span><span>           </span><span id="local-6989586621681199932"><span class="annot"><span class="annottext">ForeignRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199932"><span class="hs-identifier hs-var">fhv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (ForeignRef (ResumeContext [HValueRef]))
-&gt; m (ForeignRef (ResumeContext [HValueRef]))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (ForeignRef (ResumeContext [HValueRef]))
 -&gt; m (ForeignRef (ResumeContext [HValueRef])))
-&gt; IO (ForeignRef (ResumeContext [HValueRef]))
-&gt; m (ForeignRef (ResumeContext [HValueRef]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; RemoteRef (ResumeContext [HValueRef])
-&gt; IO (ForeignRef (ResumeContext [HValueRef]))
forall a. HscEnv -&gt; RemoteRef a -&gt; IO (ForeignRef a)
</span><a href="GHC.Runtime.Interpreter.html#mkFinalizedHValue"><span class="hs-identifier hs-var">mkFinalizedHValue</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199950"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">RemoteRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199952"><span class="hs-identifier hs-var">resume_ctxt</span></a></span><span>
</span><span id="line-332"></span><span>           </span><span id="local-6989586621681199931"><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199931"><span class="hs-identifier hs-var">status</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (EvalStatus_ [ForeignHValue] [HValueRef])
 -&gt; m (EvalStatus_ [ForeignHValue] [HValueRef]))
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Bool
-&gt; ForeignRef (ResumeContext [HValueRef])
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
</span><a href="GHC.Runtime.Interpreter.html#resumeStmt"><span class="hs-identifier hs-var">GHCi.resumeStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199950"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">ForeignRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199932"><span class="hs-identifier hs-var">fhv</span></a></span><span>
</span><span id="line-333"></span><span>           </span><span class="annot"><span class="annottext">SingleStep
-&gt; String
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; EvalStatus_ [ForeignHValue] [HValueRef]
-&gt; BoundedList History
-&gt; m ExecResult
forall (m :: * -&gt; *).
GhcMonad m =&gt;
SingleStep
-&gt; String
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; EvalStatus_ [ForeignHValue] [HValueRef]
-&gt; BoundedList History
-&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#handleRunStatus"><span class="hs-identifier hs-var">handleRunStatus</span></a></span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="GHC.Runtime.Eval.Types.html#RunAndLogSteps"><span class="hs-identifier hs-var">RunAndLogSteps</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199976"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">([TyThing], GlobalRdrEnv)
</span><a href="#local-6989586621681199975"><span class="hs-identifier hs-var">bindings</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199974"><span class="hs-identifier hs-var">final_ids</span></a></span><span>
</span><span id="line-334"></span><span>                           </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199931"><span class="hs-identifier hs-var">status</span></a></span><span> </span><span class="annot"><span class="annottext">BoundedList History
</span><a href="#local-6989586621681199934"><span class="hs-identifier hs-var">history'</span></a></span><span>
</span><span id="line-335"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-336"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m ExecResult
</span><a href="#local-6989586621681199969"><span class="hs-identifier hs-var">not_tracing</span></a></span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span>  </span><span id="local-6989586621681199969"><span class="annot"><span class="annottext">not_tracing :: m ExecResult
</span><a href="#local-6989586621681199969"><span class="hs-identifier hs-var hs-var">not_tracing</span></a></span></span><span>
</span><span id="line-339"></span><span>    </span><span class="hs-comment">-- Hit a breakpoint</span><span>
</span><span id="line-340"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalBreak"><span class="hs-identifier hs-type">EvalBreak</span></a></span><span> </span><span id="local-6989586621681199908"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199908"><span class="hs-identifier hs-var">is_exception</span></a></span></span><span> </span><span id="local-6989586621681199907"><span class="annot"><span class="annottext">HValueRef
</span><a href="#local-6989586621681199907"><span class="hs-identifier hs-var">apStack_ref</span></a></span></span><span> </span><span id="local-6989586621681199906"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199906"><span class="hs-identifier hs-var">ix</span></a></span></span><span> </span><span id="local-6989586621681199905"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199905"><span class="hs-identifier hs-var">mod_uniq</span></a></span></span><span> </span><span id="local-6989586621681199904"><span class="annot"><span class="annottext">RemoteRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199904"><span class="hs-identifier hs-var">resume_ctxt</span></a></span></span><span> </span><span id="local-6989586621681199903"><span class="annot"><span class="annottext">RemotePtr CostCentreStack
</span><a href="#local-6989586621681199903"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199973"><span class="hs-identifier hs-var">status</span></a></span><span>
</span><span id="line-341"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-342"></span><span>         </span><span id="local-6989586621681199902"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199902"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-343"></span><span>         </span><span id="local-6989586621681199901"><span class="annot"><span class="annottext">ForeignRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199901"><span class="hs-identifier hs-var">resume_ctxt_fhv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (ForeignRef (ResumeContext [HValueRef]))
-&gt; m (ForeignRef (ResumeContext [HValueRef]))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (ForeignRef (ResumeContext [HValueRef]))
 -&gt; m (ForeignRef (ResumeContext [HValueRef])))
-&gt; IO (ForeignRef (ResumeContext [HValueRef]))
-&gt; m (ForeignRef (ResumeContext [HValueRef]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; RemoteRef (ResumeContext [HValueRef])
-&gt; IO (ForeignRef (ResumeContext [HValueRef]))
forall a. HscEnv -&gt; RemoteRef a -&gt; IO (ForeignRef a)
</span><a href="GHC.Runtime.Interpreter.html#mkFinalizedHValue"><span class="hs-identifier hs-var">mkFinalizedHValue</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199902"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">RemoteRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199904"><span class="hs-identifier hs-var">resume_ctxt</span></a></span><span>
</span><span id="line-344"></span><span>         </span><span id="local-6989586621681199900"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199900"><span class="hs-identifier hs-var">apStack_fhv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ForeignHValue -&gt; m ForeignHValue
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ForeignHValue -&gt; m ForeignHValue)
-&gt; IO ForeignHValue -&gt; m ForeignHValue
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; HValueRef -&gt; IO ForeignHValue
forall a. HscEnv -&gt; RemoteRef a -&gt; IO (ForeignRef a)
</span><a href="GHC.Runtime.Interpreter.html#mkFinalizedHValue"><span class="hs-identifier hs-var">mkFinalizedHValue</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199902"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">HValueRef
</span><a href="#local-6989586621681199907"><span class="hs-identifier hs-var">apStack_ref</span></a></span><span>
</span><span id="line-345"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199897"><span class="annot"><span class="annottext">hmi :: HomeModInfo
</span><a href="#local-6989586621681199897"><span class="hs-identifier hs-var hs-var">hmi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;handleRunStatus&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe HomeModInfo -&gt; HomeModInfo)
-&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-346"></span><span>                     </span><span class="annot"><span class="annottext">HomePackageTable -&gt; Unique -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHptDirectly"><span class="hs-identifier hs-var">lookupHptDirectly</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199902"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Unique
</span><a href="GHC.Types.Unique.html#mkUniqueGrimily"><span class="hs-identifier hs-var">mkUniqueGrimily</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199905"><span class="hs-identifier hs-var">mod_uniq</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span>             </span><span id="local-6989586621681199896"><span class="annot"><span class="annottext">modl :: Module
</span><a href="#local-6989586621681199896"><span class="hs-identifier hs-var hs-var">modl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModIface_ 'ModIfaceFinal -&gt; Module
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; Module
</span><a href="GHC.Driver.Types.html#mi_module"><span class="hs-identifier hs-var hs-var">mi_module</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface_ 'ModIfaceFinal
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199897"><span class="hs-identifier hs-var">hmi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-349"></span><span>             </span><span id="local-6989586621681199895"><span class="annot"><span class="annottext">bp :: Maybe BreakInfo
</span><a href="#local-6989586621681199895"><span class="hs-identifier hs-var hs-var">bp</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199908"><span class="hs-identifier hs-var">is_exception</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-350"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BreakInfo -&gt; Maybe BreakInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Int -&gt; BreakInfo
</span><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-var">BreakInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199896"><span class="hs-identifier hs-var">modl</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199906"><span class="hs-identifier hs-var">ix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621681199894"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199894"><span class="hs-identifier hs-var">hsc_env1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199893"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199893"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199892"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199892"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199891"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199891"><span class="hs-identifier hs-var">decl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (HscEnv, [Name], SrcSpan, String)
-&gt; m (HscEnv, [Name], SrcSpan, String)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (HscEnv, [Name], SrcSpan, String)
 -&gt; m (HscEnv, [Name], SrcSpan, String))
-&gt; IO (HscEnv, [Name], SrcSpan, String)
-&gt; m (HscEnv, [Name], SrcSpan, String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-352"></span><span>           </span><span class="annot"><span class="annottext">HscEnv
-&gt; ForeignHValue
-&gt; Maybe BreakInfo
-&gt; IO (HscEnv, [Name], SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#bindLocalsAtBreakpoint"><span class="hs-identifier hs-var">bindLocalsAtBreakpoint</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199902"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199900"><span class="hs-identifier hs-var">apStack_fhv</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199895"><span class="hs-identifier hs-var">bp</span></a></span><span>
</span><span id="line-353"></span><span>         </span><span class="hs-keyword">let</span><span>
</span><span id="line-354"></span><span>           </span><span id="local-6989586621681199889"><span class="annot"><span class="annottext">resume :: Resume
</span><a href="#local-6989586621681199889"><span class="hs-identifier hs-var hs-var">resume</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Resume :: String
-&gt; ForeignRef (ResumeContext [HValueRef])
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; ForeignHValue
-&gt; Maybe BreakInfo
-&gt; SrcSpan
-&gt; String
-&gt; RemotePtr CostCentreStack
-&gt; [History]
-&gt; Int
-&gt; Resume
</span><a href="GHC.Runtime.Eval.Types.html#Resume"><span class="hs-identifier hs-type">Resume</span></a></span><span>
</span><span id="line-355"></span><span>             </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">resumeStmt :: String
</span><a href="GHC.Runtime.Eval.Types.html#resumeStmt"><span class="hs-identifier hs-var">resumeStmt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199976"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeContext :: ForeignRef (ResumeContext [HValueRef])
</span><a href="GHC.Runtime.Eval.Types.html#resumeContext"><span class="hs-identifier hs-var">resumeContext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199901"><span class="hs-identifier hs-var">resume_ctxt_fhv</span></a></span><span>
</span><span id="line-356"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeBindings :: ([TyThing], GlobalRdrEnv)
</span><a href="GHC.Runtime.Eval.Types.html#resumeBindings"><span class="hs-identifier hs-var">resumeBindings</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([TyThing], GlobalRdrEnv)
</span><a href="#local-6989586621681199975"><span class="hs-identifier hs-var">bindings</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeFinalIds :: [Id]
</span><a href="GHC.Runtime.Eval.Types.html#resumeFinalIds"><span class="hs-identifier hs-var">resumeFinalIds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199974"><span class="hs-identifier hs-var">final_ids</span></a></span><span>
</span><span id="line-357"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeApStack :: ForeignHValue
</span><a href="GHC.Runtime.Eval.Types.html#resumeApStack"><span class="hs-identifier hs-var">resumeApStack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199900"><span class="hs-identifier hs-var">apStack_fhv</span></a></span><span>
</span><span id="line-358"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeBreakInfo :: Maybe BreakInfo
</span><a href="GHC.Runtime.Eval.Types.html#resumeBreakInfo"><span class="hs-identifier hs-var">resumeBreakInfo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199895"><span class="hs-identifier hs-var">bp</span></a></span><span>
</span><span id="line-359"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeSpan :: SrcSpan
</span><a href="GHC.Runtime.Eval.Types.html#resumeSpan"><span class="hs-identifier hs-var">resumeSpan</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199892"><span class="hs-identifier hs-var">span</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeHistory :: [History]
</span><a href="GHC.Runtime.Eval.Types.html#resumeHistory"><span class="hs-identifier hs-var">resumeHistory</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BoundedList History -&gt; [History]
forall a. BoundedList a -&gt; [a]
</span><a href="GHC.Runtime.Eval.html#toListBL"><span class="hs-identifier hs-var">toListBL</span></a></span><span> </span><span class="annot"><span class="annottext">BoundedList History
</span><a href="#local-6989586621681199972"><span class="hs-identifier hs-var">history</span></a></span><span>
</span><span id="line-360"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeDecl :: String
</span><a href="GHC.Runtime.Eval.Types.html#resumeDecl"><span class="hs-identifier hs-var">resumeDecl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199891"><span class="hs-identifier hs-var">decl</span></a></span><span>
</span><span id="line-361"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeCCS :: RemotePtr CostCentreStack
</span><a href="GHC.Runtime.Eval.Types.html#resumeCCS"><span class="hs-identifier hs-var">resumeCCS</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RemotePtr CostCentreStack
</span><a href="#local-6989586621681199903"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-362"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeHistoryIx :: Int
</span><a href="GHC.Runtime.Eval.Types.html#resumeHistoryIx"><span class="hs-identifier hs-var">resumeHistoryIx</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-363"></span><span>           </span><span id="local-6989586621681199875"><span class="annot"><span class="annottext">hsc_env2 :: HscEnv
</span><a href="#local-6989586621681199875"><span class="hs-identifier hs-var hs-var">hsc_env2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Resume -&gt; HscEnv
</span><a href="GHC.Runtime.Eval.html#pushResume"><span class="hs-identifier hs-var">pushResume</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199894"><span class="hs-identifier hs-var">hsc_env1</span></a></span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199889"><span class="hs-identifier hs-var">resume</span></a></span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span>         </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199875"><span class="hs-identifier hs-var">hsc_env2</span></a></span><span>
</span><span id="line-366"></span><span>         </span><span class="annot"><span class="annottext">ExecResult -&gt; m ExecResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Maybe BreakInfo -&gt; ExecResult
</span><a href="GHC.Runtime.Eval.Types.html#ExecBreak"><span class="hs-identifier hs-var">ExecBreak</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199893"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199895"><span class="hs-identifier hs-var">bp</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>
</span><span id="line-368"></span><span>    </span><span class="hs-comment">-- Completed successfully</span><span>
</span><span id="line-369"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalComplete"><span class="hs-identifier hs-type">EvalComplete</span></a></span><span> </span><span id="local-6989586621681199871"><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621681199871"><span class="hs-identifier hs-var">allocs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalSuccess"><span class="hs-identifier hs-type">EvalSuccess</span></a></span><span> </span><span id="local-6989586621681199869"><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681199869"><span class="hs-identifier hs-var">hvals</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199973"><span class="hs-identifier hs-var">status</span></a></span><span>
</span><span id="line-370"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681199868"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199868"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-371"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199867"><span class="annot"><span class="annottext">final_ic :: InteractiveContext
</span><a href="#local-6989586621681199867"><span class="hs-identifier hs-var hs-var">final_ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Id] -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#extendInteractiveContextWithIds"><span class="hs-identifier hs-var">extendInteractiveContextWithIds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199868"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199974"><span class="hs-identifier hs-var">final_ids</span></a></span><span>
</span><span id="line-372"></span><span>             </span><span id="local-6989586621681199864"><span class="annot"><span class="annottext">final_names :: [Name]
</span><a href="#local-6989586621681199864"><span class="hs-identifier hs-var hs-var">final_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Name) -&gt; [Id] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199974"><span class="hs-identifier hs-var">final_ids</span></a></span><span>
</span><span id="line-373"></span><span>             </span><span id="local-6989586621681199863"><span class="annot"><span class="annottext">dl :: DynLinker
</span><a href="#local-6989586621681199863"><span class="hs-identifier hs-var hs-var">dl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynLinker
</span><a href="GHC.Driver.Types.html#hsc_dynLinker"><span class="hs-identifier hs-var hs-var">hsc_dynLinker</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199868"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-374"></span><span>         </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker -&gt; [(Name, ForeignHValue)] -&gt; IO ()
</span><a href="GHC.Runtime.Linker.html#extendLinkEnv"><span class="hs-identifier hs-var">Linker.extendLinkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker
</span><a href="#local-6989586621681199863"><span class="hs-identifier hs-var">dl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; [ForeignHValue] -&gt; [(Name, ForeignHValue)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199864"><span class="hs-identifier hs-var">final_names</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681199869"><span class="hs-identifier hs-var">hvals</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span>         </span><span id="local-6989586621681199860"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199860"><span class="hs-identifier hs-var">hsc_env'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO HscEnv -&gt; m HscEnv
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO HscEnv -&gt; m HscEnv) -&gt; IO HscEnv -&gt; m HscEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
</span><a href="GHC.Runtime.Eval.html#rttiEnvironment"><span class="hs-identifier hs-var">rttiEnvironment</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199868"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199867"><span class="hs-identifier hs-var">final_ic</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-376"></span><span>         </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199860"><span class="hs-identifier hs-var">hsc_env'</span></a></span><span>
</span><span id="line-377"></span><span>         </span><span class="annot"><span class="annottext">ExecResult -&gt; m ExecResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either SomeException [Name] -&gt; Word64 -&gt; ExecResult
</span><a href="GHC.Runtime.Eval.Types.html#ExecComplete"><span class="hs-identifier hs-var">ExecComplete</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Either SomeException [Name]
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199864"><span class="hs-identifier hs-var">final_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621681199871"><span class="hs-identifier hs-var">allocs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span>    </span><span class="hs-comment">-- Completed with an exception</span><span>
</span><span id="line-380"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalComplete"><span class="hs-identifier hs-type">EvalComplete</span></a></span><span> </span><span id="local-6989586621681199859"><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621681199859"><span class="hs-identifier hs-var">alloc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalException"><span class="hs-identifier hs-type">EvalException</span></a></span><span> </span><span id="local-6989586621681199857"><span class="annot"><span class="annottext">SerializableException
</span><a href="#local-6989586621681199857"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199973"><span class="hs-identifier hs-var">status</span></a></span><span>
</span><span id="line-381"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ExecResult -&gt; m ExecResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either SomeException [Name] -&gt; Word64 -&gt; ExecResult
</span><a href="GHC.Runtime.Eval.Types.html#ExecComplete"><span class="hs-identifier hs-var">ExecComplete</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; Either SomeException [Name]
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SerializableException -&gt; SomeException
</span><a href="../../ghci/src/GHCi.Message.html#fromSerializableException"><span class="hs-identifier hs-var">fromSerializableException</span></a></span><span> </span><span class="annot"><span class="annottext">SerializableException
</span><a href="#local-6989586621681199857"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621681199859"><span class="hs-identifier hs-var">alloc</span></a></span><span class="hs-special">)</span><span class="hs-cpp">

#if __GLASGOW_HASKELL__ &lt;= 810
</span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">otherwise</span><span>
</span><span id="line-385"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">panic</span><span> </span><span class="hs-string">&quot;not_tracing&quot;</span><span> </span><span class="hs-comment">-- actually exhaustive, but GHC can't tell</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-388"></span><span>
</span><span id="line-389"></span><span id="local-6989586621681200675"><span class="annot"><a href="GHC.Runtime.Eval.html#resumeExec"><span class="hs-identifier hs-type">resumeExec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200675"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#SingleStep"><span class="hs-identifier hs-type">SingleStep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200675"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#ExecResult"><span class="hs-identifier hs-type">ExecResult</span></a></span></span><span>
</span><span id="line-390"></span><span id="resumeExec"><span class="annot"><span class="annottext">resumeExec :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
(SrcSpan -&gt; Bool) -&gt; SingleStep -&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#resumeExec"><span class="hs-identifier hs-var hs-var">resumeExec</span></a></span></span><span> </span><span id="local-6989586621681199838"><span class="annot"><span class="annottext">SrcSpan -&gt; Bool
</span><a href="#local-6989586621681199838"><span class="hs-identifier hs-var">canLogSpan</span></a></span></span><span> </span><span id="local-6989586621681199837"><span class="annot"><span class="annottext">SingleStep
</span><a href="#local-6989586621681199837"><span class="hs-identifier hs-var">step</span></a></span></span><span>
</span><span id="line-391"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-392"></span><span>   </span><span id="local-6989586621681199836"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199836"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-393"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199835"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681199835"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199836"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-394"></span><span>       </span><span id="local-6989586621681199834"><span class="annot"><span class="annottext">resume :: [Resume]
</span><a href="#local-6989586621681199834"><span class="hs-identifier hs-var hs-var">resume</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var hs-var">ic_resume</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199835"><span class="hs-identifier hs-var">ic</span></a></span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199834"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-397"></span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO ExecResult -&gt; m ExecResult
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ExecResult -&gt; m ExecResult) -&gt; IO ExecResult -&gt; m ExecResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-398"></span><span>           </span><span class="annot"><span class="annottext">GhcException -&gt; IO ExecResult
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not stopped at a breakpoint&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-399"></span><span>     </span><span class="hs-special">(</span><span id="local-6989586621681199831"><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199831"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681199830"><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199830"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-400"></span><span>        </span><span class="hs-comment">-- unbind the temporary locals by restoring the TypeEnv from</span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-comment">-- before the breakpoint, and drop this Resume from the</span><span>
</span><span id="line-402"></span><span>        </span><span class="hs-comment">-- InteractiveContext.</span><span>
</span><span id="line-403"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681199829"><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681199829"><span class="hs-identifier hs-var">resume_tmp_te</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681199828"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199828"><span class="hs-identifier hs-var">resume_rdr_env</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Resume -&gt; ([TyThing], GlobalRdrEnv)
</span><a href="GHC.Runtime.Eval.Types.html#resumeBindings"><span class="hs-identifier hs-var hs-var">resumeBindings</span></a></span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199831"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-404"></span><span>            </span><span id="local-6989586621681199827"><span class="annot"><span class="annottext">ic' :: InteractiveContext
</span><a href="#local-6989586621681199827"><span class="hs-identifier hs-var hs-var">ic'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199835"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_tythings :: [TyThing]
</span><a href="GHC.Driver.Types.html#ic_tythings"><span class="hs-identifier hs-var">ic_tythings</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681199829"><span class="hs-identifier hs-var">resume_tmp_te</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-405"></span><span>                       </span><span class="annot"><span class="annottext">ic_rn_gbl_env :: GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#ic_rn_gbl_env"><span class="hs-identifier hs-var">ic_rn_gbl_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199828"><span class="hs-identifier hs-var">resume_rdr_env</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-406"></span><span>                       </span><span class="annot"><span class="annottext">ic_resume :: [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var">ic_resume</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199830"><span class="hs-identifier hs-var">rs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-407"></span><span>        </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199836"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199827"><span class="hs-identifier hs-var">ic'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span>        </span><span class="hs-comment">-- remove any bindings created since the breakpoint from the</span><span>
</span><span id="line-410"></span><span>        </span><span class="hs-comment">-- linker's environment</span><span>
</span><span id="line-411"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199825"><span class="annot"><span class="annottext">old_names :: [Name]
</span><a href="#local-6989586621681199825"><span class="hs-identifier hs-var hs-var">old_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyThing -&gt; Name) -&gt; [TyThing] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TyThing -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681199829"><span class="hs-identifier hs-var">resume_tmp_te</span></a></span><span>
</span><span id="line-412"></span><span>            </span><span id="local-6989586621681199821"><span class="annot"><span class="annottext">new_names :: [Name]
</span><a href="#local-6989586621681199821"><span class="hs-identifier hs-var hs-var">new_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199820"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681199819"><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681199819"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#ic_tythings"><span class="hs-identifier hs-var hs-var">ic_tythings</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199835"><span class="hs-identifier hs-var">ic</span></a></span><span>
</span><span id="line-413"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199820"><span class="annot"><span class="annottext">n :: Name
</span><a href="#local-6989586621681199820"><span class="hs-identifier hs-var hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyThing -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681199819"><span class="hs-identifier hs-var">thing</span></a></span><span>
</span><span id="line-414"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199820"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199825"><span class="hs-identifier hs-var">old_names</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-415"></span><span>            </span><span id="local-6989586621681199816"><span class="annot"><span class="annottext">dl :: DynLinker
</span><a href="#local-6989586621681199816"><span class="hs-identifier hs-var hs-var">dl</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynLinker
</span><a href="GHC.Driver.Types.html#hsc_dynLinker"><span class="hs-identifier hs-var hs-var">hsc_dynLinker</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199836"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-416"></span><span>        </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker -&gt; [Name] -&gt; IO ()
</span><a href="GHC.Runtime.Linker.html#deleteFromLinkEnv"><span class="hs-identifier hs-var">Linker.deleteFromLinkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker
</span><a href="#local-6989586621681199816"><span class="hs-identifier hs-var">dl</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199821"><span class="hs-identifier hs-var">new_names</span></a></span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199831"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-419"></span><span>          </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#Resume"><span class="hs-identifier hs-type">Resume</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">resumeStmt :: Resume -&gt; String
</span><a href="GHC.Runtime.Eval.Types.html#resumeStmt"><span class="hs-identifier hs-var">resumeStmt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199814"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199814"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeContext :: Resume -&gt; ForeignRef (ResumeContext [HValueRef])
</span><a href="GHC.Runtime.Eval.Types.html#resumeContext"><span class="hs-identifier hs-var">resumeContext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199813"><span class="annot"><span class="annottext">ForeignRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199813"><span class="hs-identifier hs-var">fhv</span></a></span></span><span>
</span><span id="line-420"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeBindings :: Resume -&gt; ([TyThing], GlobalRdrEnv)
</span><a href="GHC.Runtime.Eval.Types.html#resumeBindings"><span class="hs-identifier hs-var">resumeBindings</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199812"><span class="annot"><span class="annottext">([TyThing], GlobalRdrEnv)
</span><a href="#local-6989586621681199812"><span class="hs-identifier hs-var">bindings</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeFinalIds :: Resume -&gt; [Id]
</span><a href="GHC.Runtime.Eval.Types.html#resumeFinalIds"><span class="hs-identifier hs-var">resumeFinalIds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199811"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199811"><span class="hs-identifier hs-var">final_ids</span></a></span></span><span>
</span><span id="line-421"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeApStack :: Resume -&gt; ForeignHValue
</span><a href="GHC.Runtime.Eval.Types.html#resumeApStack"><span class="hs-identifier hs-var">resumeApStack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199810"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199810"><span class="hs-identifier hs-var">apStack</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeBreakInfo :: Resume -&gt; Maybe BreakInfo
</span><a href="GHC.Runtime.Eval.Types.html#resumeBreakInfo"><span class="hs-identifier hs-var">resumeBreakInfo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199809"><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199809"><span class="hs-identifier hs-var">mb_brkpt</span></a></span></span><span>
</span><span id="line-422"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeSpan :: Resume -&gt; SrcSpan
</span><a href="GHC.Runtime.Eval.Types.html#resumeSpan"><span class="hs-identifier hs-var">resumeSpan</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199808"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199808"><span class="hs-identifier hs-var">span</span></a></span></span><span>
</span><span id="line-423"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">resumeHistory :: Resume -&gt; [History]
</span><a href="GHC.Runtime.Eval.Types.html#resumeHistory"><span class="hs-identifier hs-var">resumeHistory</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199807"><span class="annot"><span class="annottext">[History]
</span><a href="#local-6989586621681199807"><span class="hs-identifier hs-var">hist</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-424"></span><span>               </span><span class="annot"><span class="annottext">m ExecResult -&gt; m ExecResult
forall (m :: * -&gt; *) a. GhcMonad m =&gt; m a -&gt; m a
</span><a href="GHC.Runtime.Eval.html#withVirtualCWD"><span class="hs-identifier hs-var">withVirtualCWD</span></a></span><span> </span><span class="annot"><span class="annottext">(m ExecResult -&gt; m ExecResult) -&gt; m ExecResult -&gt; m ExecResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-425"></span><span>                </span><span id="local-6989586621681199806"><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199806"><span class="hs-identifier hs-var">status</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (EvalStatus_ [ForeignHValue] [HValueRef])
 -&gt; m (EvalStatus_ [ForeignHValue] [HValueRef]))
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Bool
-&gt; ForeignRef (ResumeContext [HValueRef])
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
</span><a href="GHC.Runtime.Interpreter.html#resumeStmt"><span class="hs-identifier hs-var">GHCi.resumeStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199836"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SingleStep -&gt; Bool
</span><a href="GHC.Runtime.Eval.Types.html#isStep"><span class="hs-identifier hs-var">isStep</span></a></span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="#local-6989586621681199837"><span class="hs-identifier hs-var">step</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignRef (ResumeContext [HValueRef])
</span><a href="#local-6989586621681199813"><span class="hs-identifier hs-var">fhv</span></a></span><span>
</span><span id="line-426"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199805"><span class="annot"><span class="annottext">prevHistoryLst :: BoundedList History
</span><a href="#local-6989586621681199805"><span class="hs-identifier hs-var hs-var">prevHistoryLst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [History] -&gt; BoundedList History
forall a. Int -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#fromListBL"><span class="hs-identifier hs-var">fromListBL</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">50</span></span><span> </span><span class="annot"><span class="annottext">[History]
</span><a href="#local-6989586621681199807"><span class="hs-identifier hs-var">hist</span></a></span><span>
</span><span id="line-427"></span><span>                    </span><span id="local-6989586621681199803"><span class="annot"><span class="annottext">hist' :: BoundedList History
</span><a href="#local-6989586621681199803"><span class="hs-identifier hs-var hs-var">hist'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199809"><span class="hs-identifier hs-var">mb_brkpt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-428"></span><span>                       </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BoundedList History
</span><a href="#local-6989586621681199805"><span class="hs-identifier hs-var">prevHistoryLst</span></a></span><span>
</span><span id="line-429"></span><span>                       </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199802"><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681199802"><span class="hs-identifier hs-var">bi</span></a></span></span><span>
</span><span id="line-430"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span class="annot"><span class="annottext">SrcSpan -&gt; Bool
</span><a href="#local-6989586621681199838"><span class="hs-identifier hs-var">canLogSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199808"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BoundedList History
</span><a href="#local-6989586621681199805"><span class="hs-identifier hs-var">prevHistoryLst</span></a></span><span>
</span><span id="line-431"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; BreakInfo -&gt; History
</span><a href="GHC.Runtime.Eval.html#mkHistory"><span class="hs-identifier hs-var">mkHistory</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199836"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199810"><span class="hs-identifier hs-var">apStack</span></a></span><span> </span><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681199802"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">History -&gt; BoundedList History -&gt; BoundedList History
forall a. a -&gt; BoundedList a -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#consBL"><span class="hs-operator hs-var">`consBL`</span></a></span><span>
</span><span id="line-432"></span><span>                                                        </span><span class="annot"><span class="annottext">Int -&gt; [History] -&gt; BoundedList History
forall a. Int -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#fromListBL"><span class="hs-identifier hs-var">fromListBL</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">50</span></span><span> </span><span class="annot"><span class="annottext">[History]
</span><a href="#local-6989586621681199807"><span class="hs-identifier hs-var">hist</span></a></span><span>
</span><span id="line-433"></span><span>                </span><span class="annot"><span class="annottext">SingleStep
-&gt; String
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; EvalStatus_ [ForeignHValue] [HValueRef]
-&gt; BoundedList History
-&gt; m ExecResult
forall (m :: * -&gt; *).
GhcMonad m =&gt;
SingleStep
-&gt; String
-&gt; ([TyThing], GlobalRdrEnv)
-&gt; [Id]
-&gt; EvalStatus_ [ForeignHValue] [HValueRef]
-&gt; BoundedList History
-&gt; m ExecResult
</span><a href="GHC.Runtime.Eval.html#handleRunStatus"><span class="hs-identifier hs-var">handleRunStatus</span></a></span><span> </span><span class="annot"><span class="annottext">SingleStep
</span><a href="#local-6989586621681199837"><span class="hs-identifier hs-var">step</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199814"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">([TyThing], GlobalRdrEnv)
</span><a href="#local-6989586621681199812"><span class="hs-identifier hs-var">bindings</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199811"><span class="hs-identifier hs-var">final_ids</span></a></span><span> </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681199806"><span class="hs-identifier hs-var">status</span></a></span><span> </span><span class="annot"><span class="annottext">BoundedList History
</span><a href="#local-6989586621681199803"><span class="hs-identifier hs-var">hist'</span></a></span><span>
</span><span id="line-434"></span><span>
</span><span id="line-435"></span><span id="local-6989586621681200668"><span class="annot"><a href="GHC.Runtime.Eval.html#back"><span class="hs-identifier hs-type">back</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200668"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200668"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-436"></span><span id="back"><span class="annot"><span class="annottext">back :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Int -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#back"><span class="hs-identifier hs-var hs-var">back</span></a></span></span><span> </span><span id="local-6989586621681199798"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199798"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int) -&gt; m ([Name], Int, SrcSpan, String)
forall (m :: * -&gt; *).
GhcMonad m =&gt;
(Int -&gt; Int) -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#moveHist"><span class="hs-identifier hs-var">moveHist</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199798"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span id="local-6989586621681199795"><span class="annot"><a href="GHC.Runtime.Eval.html#forward"><span class="hs-identifier hs-type">forward</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681199795"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681199795"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-439"></span><span id="forward"><span class="annot"><span class="annottext">forward :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Int -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#forward"><span class="hs-identifier hs-var hs-var">forward</span></a></span></span><span> </span><span id="local-6989586621681199791"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199791"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int) -&gt; m ([Name], Int, SrcSpan, String)
forall (m :: * -&gt; *).
GhcMonad m =&gt;
(Int -&gt; Int) -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#moveHist"><span class="hs-identifier hs-var">moveHist</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#subtract"><span class="hs-identifier hs-var">subtract</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199791"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span id="local-6989586621681200666"><span class="annot"><a href="GHC.Runtime.Eval.html#moveHist"><span class="hs-identifier hs-type">moveHist</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200666"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200666"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-442"></span><span id="moveHist"><span class="annot"><span class="annottext">moveHist :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
(Int -&gt; Int) -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#moveHist"><span class="hs-identifier hs-var hs-var">moveHist</span></a></span></span><span> </span><span id="local-6989586621681199762"><span class="annot"><span class="annottext">Int -&gt; Int
</span><a href="#local-6989586621681199762"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-443"></span><span>  </span><span id="local-6989586621681199761"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199761"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-444"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var hs-var">ic_resume</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199761"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-445"></span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO ([Name], Int, SrcSpan, String)
-&gt; m ([Name], Int, SrcSpan, String)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ([Name], Int, SrcSpan, String)
 -&gt; m ([Name], Int, SrcSpan, String))
-&gt; IO ([Name], Int, SrcSpan, String)
-&gt; m ([Name], Int, SrcSpan, String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-446"></span><span>           </span><span class="annot"><span class="annottext">GhcException -&gt; IO ([Name], Int, SrcSpan, String)
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not stopped at a breakpoint&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span>     </span><span class="hs-special">(</span><span id="local-6989586621681199760"><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199760"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681199759"><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199759"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-448"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199758"><span class="annot"><span class="annottext">ix :: Int
</span><a href="#local-6989586621681199758"><span class="hs-identifier hs-var hs-var">ix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Resume -&gt; Int
</span><a href="GHC.Runtime.Eval.Types.html#resumeHistoryIx"><span class="hs-identifier hs-var hs-var">resumeHistoryIx</span></a></span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199760"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-449"></span><span>            </span><span id="local-6989586621681199757"><span class="annot"><span class="annottext">history :: [History]
</span><a href="#local-6989586621681199757"><span class="hs-identifier hs-var hs-var">history</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Resume -&gt; [History]
</span><a href="GHC.Runtime.Eval.Types.html#resumeHistory"><span class="hs-identifier hs-var hs-var">resumeHistory</span></a></span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199760"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-450"></span><span>            </span><span id="local-6989586621681199756"><span class="annot"><span class="annottext">new_ix :: Int
</span><a href="#local-6989586621681199756"><span class="hs-identifier hs-var hs-var">new_ix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
</span><a href="#local-6989586621681199762"><span class="hs-identifier hs-var">fn</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199758"><span class="hs-identifier hs-var">ix</span></a></span><span>
</span><span id="line-451"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-452"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; m () -&gt; m ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[History]
</span><a href="#local-6989586621681199757"><span class="hs-identifier hs-var">history</span></a></span><span> </span><span class="annot"><span class="annottext">[History] -&gt; Int -&gt; Bool
forall a. [a] -&gt; Int -&gt; Bool
</span><a href="GHC.Utils.Misc.html#lengthLessThan"><span class="hs-operator hs-var">`lengthLessThan`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199756"><span class="hs-identifier hs-var">new_ix</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m () -&gt; m ()) -&gt; m () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-453"></span><span>           </span><span class="annot"><span class="annottext">GhcException -&gt; IO ()
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no more logged breakpoints&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-454"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; m () -&gt; m ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199756"><span class="hs-identifier hs-var">new_ix</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m () -&gt; m ()) -&gt; m () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-455"></span><span>           </span><span class="annot"><span class="annottext">GhcException -&gt; IO ()
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;already at the beginning of the history&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span>        </span><span class="hs-keyword">let</span><span>
</span><span id="line-458"></span><span>          </span><span id="local-6989586621681199741"><span class="annot"><span class="annottext">update_ic :: ForeignHValue
-&gt; Maybe BreakInfo -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="#local-6989586621681199741"><span class="hs-identifier hs-var hs-var">update_ic</span></a></span></span><span> </span><span id="local-6989586621681199740"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199740"><span class="hs-identifier hs-var">apStack</span></a></span></span><span> </span><span id="local-6989586621681199739"><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199739"><span class="hs-identifier hs-var">mb_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-459"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681199738"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199738"><span class="hs-identifier hs-var">hsc_env1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199737"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199737"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199736"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199736"><span class="hs-identifier hs-var">span</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199735"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199735"><span class="hs-identifier hs-var">decl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-460"></span><span>              </span><span class="annot"><span class="annottext">IO (HscEnv, [Name], SrcSpan, String)
-&gt; m (HscEnv, [Name], SrcSpan, String)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (HscEnv, [Name], SrcSpan, String)
 -&gt; m (HscEnv, [Name], SrcSpan, String))
-&gt; IO (HscEnv, [Name], SrcSpan, String)
-&gt; m (HscEnv, [Name], SrcSpan, String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; ForeignHValue
-&gt; Maybe BreakInfo
-&gt; IO (HscEnv, [Name], SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#bindLocalsAtBreakpoint"><span class="hs-identifier hs-var">bindLocalsAtBreakpoint</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199761"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199740"><span class="hs-identifier hs-var">apStack</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199739"><span class="hs-identifier hs-var">mb_info</span></a></span><span>
</span><span id="line-461"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199734"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681199734"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199738"><span class="hs-identifier hs-var">hsc_env1</span></a></span><span>
</span><span id="line-462"></span><span>                </span><span id="local-6989586621681199733"><span class="annot"><span class="annottext">r' :: Resume
</span><a href="#local-6989586621681199733"><span class="hs-identifier hs-var hs-var">r'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199760"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">resumeHistoryIx :: Int
</span><a href="GHC.Runtime.Eval.Types.html#resumeHistoryIx"><span class="hs-identifier hs-var">resumeHistoryIx</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199756"><span class="hs-identifier hs-var">new_ix</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-463"></span><span>                </span><span id="local-6989586621681199732"><span class="annot"><span class="annottext">ic' :: InteractiveContext
</span><a href="#local-6989586621681199732"><span class="hs-identifier hs-var hs-var">ic'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199734"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_resume :: [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var">ic_resume</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199733"><span class="hs-identifier hs-var">r'</span></a></span><span class="annot"><span class="annottext">Resume -&gt; [Resume] -&gt; [Resume]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199759"><span class="hs-identifier hs-var">rs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-464"></span><span>
</span><span id="line-465"></span><span>            </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199738"><span class="hs-identifier hs-var">hsc_env1</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199732"><span class="hs-identifier hs-var">ic'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-466"></span><span>
</span><span id="line-467"></span><span>            </span><span class="annot"><span class="annottext">([Name], Int, SrcSpan, String) -&gt; m ([Name], Int, SrcSpan, String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199737"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199756"><span class="hs-identifier hs-var">new_ix</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199736"><span class="hs-identifier hs-var">span</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199735"><span class="hs-identifier hs-var">decl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span>        </span><span class="hs-comment">-- careful: we want apStack to be the AP_STACK itself, not a thunk</span><span>
</span><span id="line-470"></span><span>        </span><span class="hs-comment">-- around it, hence the cases are carefully constructed below to</span><span>
</span><span id="line-471"></span><span>        </span><span class="hs-comment">-- make this the case.  ToDo: this is v. fragile, do something better.</span><span>
</span><span id="line-472"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199756"><span class="hs-identifier hs-var">new_ix</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-473"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199760"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-474"></span><span>                   </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#Resume"><span class="hs-identifier hs-type">Resume</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">resumeApStack :: Resume -&gt; ForeignHValue
</span><a href="GHC.Runtime.Eval.Types.html#resumeApStack"><span class="hs-identifier hs-var">resumeApStack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199731"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199731"><span class="hs-identifier hs-var">apStack</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-475"></span><span>                            </span><span class="annot"><span class="annottext">resumeBreakInfo :: Resume -&gt; Maybe BreakInfo
</span><a href="GHC.Runtime.Eval.Types.html#resumeBreakInfo"><span class="hs-identifier hs-var">resumeBreakInfo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199730"><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199730"><span class="hs-identifier hs-var">mb_brkpt</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-476"></span><span>                          </span><span class="annot"><span class="annottext">ForeignHValue
-&gt; Maybe BreakInfo -&gt; m ([Name], Int, SrcSpan, String)
forall {m :: * -&gt; *}.
GhcMonad m =&gt;
ForeignHValue
-&gt; Maybe BreakInfo -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="#local-6989586621681199741"><span class="hs-identifier hs-var">update_ic</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199731"><span class="hs-identifier hs-var">apStack</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="#local-6989586621681199730"><span class="hs-identifier hs-var">mb_brkpt</span></a></span><span>
</span><span id="line-477"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[History]
</span><a href="#local-6989586621681199757"><span class="hs-identifier hs-var">history</span></a></span><span> </span><span class="annot"><span class="annottext">[History] -&gt; Int -&gt; History
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199756"><span class="hs-identifier hs-var">new_ix</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-478"></span><span>                   </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#History"><span class="hs-identifier hs-type">History</span></a></span><span class="hs-special">{</span><span id="local-6989586621681199726"><span id="local-6989586621681199727"><span id="local-6989586621681199728"><span class="annot"><span class="annottext">[String]
ForeignHValue
BreakInfo
historyEnclosingDecls :: [String]
historyBreakInfo :: BreakInfo
historyApStack :: ForeignHValue
historyEnclosingDecls :: History -&gt; [String]
historyApStack :: History -&gt; ForeignHValue
historyBreakInfo :: History -&gt; BreakInfo
</span><a href="#local-6989586621681199726"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-479"></span><span>                     </span><span class="annot"><span class="annottext">ForeignHValue
-&gt; Maybe BreakInfo -&gt; m ([Name], Int, SrcSpan, String)
forall {m :: * -&gt; *}.
GhcMonad m =&gt;
ForeignHValue
-&gt; Maybe BreakInfo -&gt; m ([Name], Int, SrcSpan, String)
</span><a href="#local-6989586621681199741"><span class="hs-identifier hs-var">update_ic</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199728"><span class="hs-identifier hs-var">historyApStack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BreakInfo -&gt; Maybe BreakInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">BreakInfo
</span><a href="#local-6989586621681199727"><span class="hs-identifier hs-var">historyBreakInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-480"></span><span>
</span><span id="line-481"></span><span>
</span><span id="line-482"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-483"></span><span class="hs-comment">-- After stopping at a breakpoint, add free variables to the environment</span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span class="annot"><a href="GHC.Runtime.Eval.html#result_fs"><span class="hs-identifier hs-type">result_fs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-486"></span><span id="result_fs"><span class="annot"><span class="annottext">result_fs :: FastString
</span><a href="GHC.Runtime.Eval.html#result_fs"><span class="hs-identifier hs-var hs-var">result_fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_result&quot;</span></span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span class="annot"><a href="GHC.Runtime.Eval.html#bindLocalsAtBreakpoint"><span class="hs-identifier hs-type">bindLocalsAtBreakpoint</span></a></span><span>
</span><span id="line-489"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-490"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span>
</span><span id="line-491"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-type">BreakInfo</span></a></span><span>
</span><span id="line-492"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span class="hs-comment">-- Nothing case: we stopped when an exception was raised, not at a</span><span>
</span><span id="line-495"></span><span class="hs-comment">-- breakpoint.  We have no location information or local variables to</span><span>
</span><span id="line-496"></span><span class="hs-comment">-- bind, all we can do is bind a local variable to the exception</span><span>
</span><span id="line-497"></span><span class="hs-comment">-- value.</span><span>
</span><span id="line-498"></span><span id="bindLocalsAtBreakpoint"><span class="annot"><span class="annottext">bindLocalsAtBreakpoint :: HscEnv
-&gt; ForeignHValue
-&gt; Maybe BreakInfo
-&gt; IO (HscEnv, [Name], SrcSpan, String)
</span><a href="GHC.Runtime.Eval.html#bindLocalsAtBreakpoint"><span class="hs-identifier hs-var hs-var">bindLocalsAtBreakpoint</span></a></span></span><span> </span><span id="local-6989586621681199723"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199723"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681199722"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199722"><span class="hs-identifier hs-var">apStack</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe BreakInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-499"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199721"><span class="annot"><span class="annottext">exn_occ :: OccName
</span><a href="#local-6989586621681199721"><span class="hs-identifier hs-var hs-var">exn_occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkVarOccFS"><span class="hs-identifier hs-var">mkVarOccFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_exception&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-500"></span><span>       </span><span id="local-6989586621681199719"><span class="annot"><span class="annottext">span :: SrcSpan
</span><a href="#local-6989586621681199719"><span class="hs-identifier hs-var hs-var">span</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SrcSpan
</span><a href="GHC.Types.SrcLoc.html#mkGeneralSrcSpan"><span class="hs-identifier hs-var">mkGeneralSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;unknown&gt;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-501"></span><span>   </span><span id="local-6989586621681199717"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199717"><span class="hs-identifier hs-var">exn_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; OccName -&gt; SrcSpan -&gt; IO Name
</span><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier hs-var">newInteractiveBinder</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199723"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681199721"><span class="hs-identifier hs-var">exn_occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199719"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-502"></span><span>
</span><span id="line-503"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199716"><span class="annot"><span class="annottext">e_fs :: FastString
</span><a href="#local-6989586621681199716"><span class="hs-identifier hs-var hs-var">e_fs</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;e&quot;</span></span><span>
</span><span id="line-504"></span><span>       </span><span id="local-6989586621681199713"><span class="annot"><span class="annottext">e_name :: Name
</span><a href="#local-6989586621681199713"><span class="hs-identifier hs-var hs-var">e_name</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkInternalName"><span class="hs-identifier hs-var">mkInternalName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681199716"><span class="hs-identifier hs-var">e_fs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkTyVarOccFS"><span class="hs-identifier hs-var">mkTyVarOccFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681199716"><span class="hs-identifier hs-var">e_fs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199719"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-505"></span><span>       </span><span id="local-6989586621681199709"><span class="annot"><span class="annottext">e_tyvar :: Id
</span><a href="#local-6989586621681199709"><span class="hs-identifier hs-var hs-var">e_tyvar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Runtime.Eval.html#mkRuntimeUnkTyVar"><span class="hs-identifier hs-var">mkRuntimeUnkTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199713"><span class="hs-identifier hs-var">e_name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-506"></span><span>       </span><span id="local-6989586621681199706"><span class="annot"><span class="annottext">exn_id :: Id
</span><a href="#local-6989586621681199706"><span class="hs-identifier hs-var hs-var">exn_id</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobal"><span class="hs-identifier hs-var">Id.mkVanillaGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199717"><span class="hs-identifier hs-var">exn_name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199709"><span class="hs-identifier hs-var">e_tyvar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-507"></span><span>
</span><span id="line-508"></span><span>       </span><span id="local-6989586621681199703"><span class="annot"><span class="annottext">ictxt0 :: InteractiveContext
</span><a href="#local-6989586621681199703"><span class="hs-identifier hs-var hs-var">ictxt0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199723"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-509"></span><span>       </span><span id="local-6989586621681199702"><span class="annot"><span class="annottext">ictxt1 :: InteractiveContext
</span><a href="#local-6989586621681199702"><span class="hs-identifier hs-var hs-var">ictxt1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Id] -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#extendInteractiveContextWithIds"><span class="hs-identifier hs-var">extendInteractiveContextWithIds</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199703"><span class="hs-identifier hs-var">ictxt0</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199706"><span class="hs-identifier hs-var">exn_id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-510"></span><span>       </span><span id="local-6989586621681199701"><span class="annot"><span class="annottext">dl :: DynLinker
</span><a href="#local-6989586621681199701"><span class="hs-identifier hs-var hs-var">dl</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynLinker
</span><a href="GHC.Driver.Types.html#hsc_dynLinker"><span class="hs-identifier hs-var hs-var">hsc_dynLinker</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199723"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-511"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-512"></span><span>   </span><span class="annot"><span class="annottext">DynLinker -&gt; [(Name, ForeignHValue)] -&gt; IO ()
</span><a href="GHC.Runtime.Linker.html#extendLinkEnv"><span class="hs-identifier hs-var">Linker.extendLinkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker
</span><a href="#local-6989586621681199701"><span class="hs-identifier hs-var">dl</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199717"><span class="hs-identifier hs-var">exn_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199722"><span class="hs-identifier hs-var">apStack</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-513"></span><span>   </span><span class="annot"><span class="annottext">(HscEnv, [Name], SrcSpan, String)
-&gt; IO (HscEnv, [Name], SrcSpan, String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199723"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199702"><span class="hs-identifier hs-var">ictxt1</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199717"><span class="hs-identifier hs-var">exn_name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199719"><span class="hs-identifier hs-var">span</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;exception thrown&gt;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-514"></span><span>
</span><span id="line-515"></span><span class="hs-comment">-- Just case: we stopped at a breakpoint, we have information about the location</span><span>
</span><span id="line-516"></span><span class="hs-comment">-- of the breakpoint and the free variables of the expression.</span><span>
</span><span id="line-517"></span><span class="annot"><a href="GHC.Runtime.Eval.html#bindLocalsAtBreakpoint"><span class="hs-identifier hs-var">bindLocalsAtBreakpoint</span></a></span><span> </span><span id="local-6989586621681199700"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681199699"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199699"><span class="hs-identifier hs-var">apStack_fhv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#BreakInfo"><span class="hs-identifier hs-type">BreakInfo</span></a></span><span class="hs-special">{</span><span id="local-6989586621681199697"><span id="local-6989586621681199698"><span class="annot"><span class="annottext">Int
Module
breakInfo_number :: Int
breakInfo_module :: Module
breakInfo_number :: BreakInfo -&gt; Int
breakInfo_module :: BreakInfo -&gt; Module
</span><a href="#local-6989586621681199697"><span class="hs-glyph hs-var hs-var hs-var hs-var">..</span></a></span></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-518"></span><span>   </span><span class="hs-keyword">let</span><span>
</span><span id="line-519"></span><span>       </span><span id="local-6989586621681199694"><span class="annot"><span class="annottext">hmi :: HomeModInfo
</span><a href="#local-6989586621681199694"><span class="hs-identifier hs-var hs-var">hmi</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;bindLocalsAtBreakpoint&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe HomeModInfo -&gt; HomeModInfo)
-&gt; Maybe HomeModInfo -&gt; HomeModInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-520"></span><span>                     </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199698"><span class="hs-identifier hs-var">breakInfo_module</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-521"></span><span>       </span><span id="local-6989586621681199693"><span class="annot"><span class="annottext">breaks :: ModBreaks
</span><a href="#local-6989586621681199693"><span class="hs-identifier hs-var hs-var">breaks</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModBreaks
</span><a href="GHC.Runtime.Interpreter.html#getModBreaks"><span class="hs-identifier hs-var">getModBreaks</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199694"><span class="hs-identifier hs-var">hmi</span></a></span><span>
</span><span id="line-522"></span><span>       </span><span id="local-6989586621681199690"><span class="annot"><span class="annottext">info :: CgBreakInfo
</span><a href="#local-6989586621681199690"><span class="hs-identifier hs-var hs-var">info</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe CgBreakInfo -&gt; CgBreakInfo
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;bindLocalsAtBreakpoint2&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe CgBreakInfo -&gt; CgBreakInfo)
-&gt; Maybe CgBreakInfo -&gt; CgBreakInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-523"></span><span>                     </span><span class="annot"><span class="annottext">Int -&gt; IntMap CgBreakInfo -&gt; Maybe CgBreakInfo
forall a. Int -&gt; IntMap a -&gt; Maybe a
</span><a href="../../containers/src/Data.IntMap.Internal.html#lookup"><span class="hs-identifier hs-var">IntMap.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199697"><span class="hs-identifier hs-var">breakInfo_number</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModBreaks -&gt; IntMap CgBreakInfo
</span><a href="GHC.ByteCode.Types.html#modBreaks_breakInfo"><span class="hs-identifier hs-var hs-var">modBreaks_breakInfo</span></a></span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="#local-6989586621681199693"><span class="hs-identifier hs-var">breaks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-524"></span><span>       </span><span id="local-6989586621681199687"><span class="annot"><span class="annottext">mbVars :: [Maybe (Id, Word16)]
</span><a href="#local-6989586621681199687"><span class="hs-identifier hs-var hs-var">mbVars</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgBreakInfo -&gt; [Maybe (Id, Word16)]
</span><a href="GHC.ByteCode.Types.html#cgb_vars"><span class="hs-identifier hs-var hs-var">cgb_vars</span></a></span><span> </span><span class="annot"><span class="annottext">CgBreakInfo
</span><a href="#local-6989586621681199690"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-525"></span><span>       </span><span id="local-6989586621681199685"><span class="annot"><span class="annottext">result_ty :: Kind
</span><a href="#local-6989586621681199685"><span class="hs-identifier hs-var hs-var">result_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgBreakInfo -&gt; Kind
</span><a href="GHC.ByteCode.Types.html#cgb_resty"><span class="hs-identifier hs-var hs-var">cgb_resty</span></a></span><span> </span><span class="annot"><span class="annottext">CgBreakInfo
</span><a href="#local-6989586621681199690"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-526"></span><span>       </span><span id="local-6989586621681199682"><span class="annot"><span class="annottext">occs :: [OccName]
</span><a href="#local-6989586621681199682"><span class="hs-identifier hs-var hs-var">occs</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModBreaks -&gt; Array Int [OccName]
</span><a href="GHC.ByteCode.Types.html#modBreaks_vars"><span class="hs-identifier hs-var hs-var">modBreaks_vars</span></a></span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="#local-6989586621681199693"><span class="hs-identifier hs-var">breaks</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int [OccName] -&gt; Int -&gt; [OccName]
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199697"><span class="hs-identifier hs-var">breakInfo_number</span></a></span><span>
</span><span id="line-527"></span><span>       </span><span id="local-6989586621681199679"><span class="annot"><span class="annottext">span :: SrcSpan
</span><a href="#local-6989586621681199679"><span class="hs-identifier hs-var hs-var">span</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModBreaks -&gt; Array Int SrcSpan
</span><a href="GHC.ByteCode.Types.html#modBreaks_locs"><span class="hs-identifier hs-var hs-var">modBreaks_locs</span></a></span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="#local-6989586621681199693"><span class="hs-identifier hs-var">breaks</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int SrcSpan -&gt; Int -&gt; SrcSpan
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199697"><span class="hs-identifier hs-var">breakInfo_number</span></a></span><span>
</span><span id="line-528"></span><span>       </span><span id="local-6989586621681199677"><span class="annot"><span class="annottext">decl :: String
</span><a href="#local-6989586621681199677"><span class="hs-identifier hs-var hs-var">decl</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.&quot;</span></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; String) -&gt; [String] -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModBreaks -&gt; Array Int [String]
</span><a href="GHC.ByteCode.Types.html#modBreaks_decls"><span class="hs-identifier hs-var hs-var">modBreaks_decls</span></a></span><span> </span><span class="annot"><span class="annottext">ModBreaks
</span><a href="#local-6989586621681199693"><span class="hs-identifier hs-var">breaks</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int [String] -&gt; Int -&gt; [String]
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199697"><span class="hs-identifier hs-var">breakInfo_number</span></a></span><span>
</span><span id="line-529"></span><span>
</span><span id="line-530"></span><span>           </span><span class="hs-comment">-- Filter out any unboxed ids by changing them to Nothings;</span><span>
</span><span id="line-531"></span><span>           </span><span class="hs-comment">-- we can't bind these at the prompt</span><span>
</span><span id="line-532"></span><span>       </span><span id="local-6989586621681199674"><span class="annot"><span class="annottext">mbPointers :: [Maybe (Id, Word16)]
</span><a href="#local-6989586621681199674"><span class="hs-identifier hs-var hs-var">mbPointers</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, Word16) -&gt; Maybe (Id, Word16)
forall {b}. Maybe (Id, b) -&gt; Maybe (Id, b)
</span><a href="#local-6989586621681199673"><span class="hs-identifier hs-var">nullUnboxed</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Id, Word16) -&gt; Maybe (Id, Word16))
-&gt; [Maybe (Id, Word16)] -&gt; [Maybe (Id, Word16)]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (Id, Word16)]
</span><a href="#local-6989586621681199687"><span class="hs-identifier hs-var">mbVars</span></a></span><span>
</span><span id="line-533"></span><span>
</span><span id="line-534"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681199671"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199671"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199670"><span class="annot"><span class="annottext">[Word16]
</span><a href="#local-6989586621681199670"><span class="hs-identifier hs-var">offsets</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199669"><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621681199669"><span class="hs-identifier hs-var">occs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Maybe (Id, Word16)] -&gt; [OccName] -&gt; ([Id], [Word16], [OccName])
forall a b c. [Maybe (a, b)] -&gt; [c] -&gt; ([a], [b], [c])
</span><a href="#local-6989586621681199668"><span class="hs-identifier hs-var">syncOccs</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (Id, Word16)]
</span><a href="#local-6989586621681199674"><span class="hs-identifier hs-var">mbPointers</span></a></span><span> </span><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621681199682"><span class="hs-identifier hs-var">occs</span></a></span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span>       </span><span id="local-6989586621681199667"><span class="annot"><span class="annottext">free_tvs :: [Id]
</span><a href="#local-6989586621681199667"><span class="hs-identifier hs-var hs-var">free_tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; [Id]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesList"><span class="hs-identifier hs-var">tyCoVarsOfTypesList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199685"><span class="hs-identifier hs-var">result_ty</span></a></span><span class="annot"><span class="annottext">Kind -&gt; [Kind] -&gt; [Kind]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">(Id -&gt; Kind) -&gt; [Id] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199671"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span>   </span><span class="hs-comment">-- It might be that getIdValFromApStack fails, because the AP_STACK</span><span>
</span><span id="line-539"></span><span>   </span><span class="hs-comment">-- has been accidentally evaluated, or something else has gone wrong.</span><span>
</span><span id="line-540"></span><span>   </span><span class="hs-comment">-- So that we don't fall over in a heap when this happens, just don't</span><span>
</span><span id="line-541"></span><span>   </span><span class="hs-comment">-- bind any free variables instead, and we emit a warning.</span><span>
</span><span id="line-542"></span><span>   </span><span id="local-6989586621681199664"><span class="annot"><span class="annottext">[Maybe ForeignHValue]
</span><a href="#local-6989586621681199664"><span class="hs-identifier hs-var">mb_hValues</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-543"></span><span>      </span><span class="annot"><span class="annottext">(Word16 -&gt; IO (Maybe ForeignHValue))
-&gt; [Word16] -&gt; IO [Maybe ForeignHValue]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; Int -&gt; IO (Maybe ForeignHValue)
</span><a href="GHC.Runtime.Interpreter.html#getBreakpointVar"><span class="hs-identifier hs-var">getBreakpointVar</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199699"><span class="hs-identifier hs-var">apStack_fhv</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; IO (Maybe ForeignHValue))
-&gt; (Word16 -&gt; Int) -&gt; Word16 -&gt; IO (Maybe ForeignHValue)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Word16]
</span><a href="#local-6989586621681199670"><span class="hs-identifier hs-var">offsets</span></a></span><span>
</span><span id="line-544"></span><span>   </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Maybe ForeignHValue -&gt; Bool) -&gt; [Maybe ForeignHValue] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ForeignHValue -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isNothing"><span class="hs-identifier hs-var">isNothing</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe ForeignHValue]
</span><a href="#local-6989586621681199664"><span class="hs-identifier hs-var">mb_hValues</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-545"></span><span>      </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var">debugTraceMsg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-546"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Warning: _result has been evaluated, some bindings have been lost&quot;</span></span><span>
</span><span id="line-547"></span><span>
</span><span id="line-548"></span><span>   </span><span id="local-6989586621681199656"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681199656"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Char -&gt; IO UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier hs-var">mkSplitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'I'</span></span><span>   </span><span class="hs-comment">-- Dodgy; will give the same uniques every time</span><span>
</span><span id="line-549"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199654"><span class="annot"><span class="annottext">tv_subst :: TCvSubst
</span><a href="#local-6989586621681199654"><span class="hs-identifier hs-var hs-var">tv_subst</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Id] -&gt; TCvSubst
</span><a href="#local-6989586621681199653"><span class="hs-identifier hs-var">newTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681199656"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199667"><span class="hs-identifier hs-var">free_tvs</span></a></span><span>
</span><span id="line-550"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681199652"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199652"><span class="hs-identifier hs-var">filtered_ids</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199651"><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621681199651"><span class="hs-identifier hs-var">occs''</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, OccName)] -&gt; ([Id], [OccName])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span>         </span><span class="hs-comment">-- again, sync the occ-names</span><span>
</span><span id="line-551"></span><span>          </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199649"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681199648"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681199649"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199649"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199647"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199647"><span class="hs-identifier hs-var">_hv</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199648"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681199648"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
-&gt; [Maybe ForeignHValue]
-&gt; [OccName]
-&gt; [(Id, Maybe ForeignHValue, OccName)]
forall a b c. [a] -&gt; [b] -&gt; [c] -&gt; [(a, b, c)]
</span><a href="../../base/src/GHC.List.html#zip3"><span class="hs-identifier hs-var">zip3</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199671"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe ForeignHValue]
</span><a href="#local-6989586621681199664"><span class="hs-identifier hs-var">mb_hValues</span></a></span><span> </span><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621681199669"><span class="hs-identifier hs-var">occs'</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-552"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681199643"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199643"><span class="hs-identifier hs-var">tidy_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [Kind] -&gt; (TidyEnv, [Kind])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTypes"><span class="hs-identifier hs-var">tidyOpenTypes</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="GHC.Types.Var.Env.html#emptyTidyEnv"><span class="hs-identifier hs-var">emptyTidyEnv</span></a></span><span> </span><span class="annot"><span class="annottext">([Kind] -&gt; (TidyEnv, [Kind])) -&gt; [Kind] -&gt; (TidyEnv, [Kind])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-553"></span><span>                      </span><span class="annot"><span class="annottext">(Id -&gt; Kind) -&gt; [Id] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; Kind -&gt; Kind
TCvSubst -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Subst.html#substTy"><span class="hs-identifier hs-var">substTy</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199654"><span class="hs-identifier hs-var">tv_subst</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; (Id -&gt; Kind) -&gt; Id -&gt; Kind
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199652"><span class="hs-identifier hs-var">filtered_ids</span></a></span><span>
</span><span id="line-554"></span><span>
</span><span id="line-555"></span><span>   </span><span id="local-6989586621681199639"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199639"><span class="hs-identifier hs-var">new_ids</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(OccName -&gt; Kind -&gt; Id -&gt; IO Id)
-&gt; [OccName] -&gt; [Kind] -&gt; [Id] -&gt; IO [Id]
forall (m :: * -&gt; *) a b c d.
Monad m =&gt;
(a -&gt; b -&gt; c -&gt; m d) -&gt; [a] -&gt; [b] -&gt; [c] -&gt; m [d]
</span><a href="GHC.Utils.Monad.html#zipWith3M"><span class="hs-identifier hs-var">zipWith3M</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Kind -&gt; Id -&gt; IO Id
</span><a href="#local-6989586621681199637"><span class="hs-identifier hs-var">mkNewId</span></a></span><span> </span><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621681199651"><span class="hs-identifier hs-var">occs''</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199643"><span class="hs-identifier hs-var">tidy_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199652"><span class="hs-identifier hs-var">filtered_ids</span></a></span><span>
</span><span id="line-556"></span><span>   </span><span id="local-6989586621681199636"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199636"><span class="hs-identifier hs-var">result_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; OccName -&gt; SrcSpan -&gt; IO Name
</span><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier hs-var">newInteractiveBinder</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkVarOccFS"><span class="hs-identifier hs-var">mkVarOccFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="GHC.Runtime.Eval.html#result_fs"><span class="hs-identifier hs-var">result_fs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199679"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-557"></span><span>
</span><span id="line-558"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199633"><span class="annot"><span class="annottext">result_id :: Id
</span><a href="#local-6989586621681199633"><span class="hs-identifier hs-var hs-var">result_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobal"><span class="hs-identifier hs-var">Id.mkVanillaGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199636"><span class="hs-identifier hs-var">result_name</span></a></span><span>
</span><span id="line-559"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; Kind -&gt; Kind
TCvSubst -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Subst.html#substTy"><span class="hs-identifier hs-var">substTy</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199654"><span class="hs-identifier hs-var">tv_subst</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199685"><span class="hs-identifier hs-var">result_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-560"></span><span>       </span><span id="local-6989586621681199632"><span class="annot"><span class="annottext">result_ok :: Bool
</span><a href="#local-6989586621681199632"><span class="hs-identifier hs-var hs-var">result_ok</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="#local-6989586621681199631"><span class="hs-identifier hs-var">isPointer</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199633"><span class="hs-identifier hs-var">result_id</span></a></span><span>
</span><span id="line-561"></span><span>
</span><span id="line-562"></span><span>       </span><span id="local-6989586621681199630"><span class="annot"><span class="annottext">final_ids :: [Id]
</span><a href="#local-6989586621681199630"><span class="hs-identifier hs-var hs-var">final_ids</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199632"><span class="hs-identifier hs-var">result_ok</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199633"><span class="hs-identifier hs-var">result_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199639"><span class="hs-identifier hs-var">new_ids</span></a></span><span>
</span><span id="line-563"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199639"><span class="hs-identifier hs-var">new_ids</span></a></span><span>
</span><span id="line-564"></span><span>       </span><span id="local-6989586621681199629"><span class="annot"><span class="annottext">ictxt0 :: InteractiveContext
</span><a href="#local-6989586621681199629"><span class="hs-identifier hs-var hs-var">ictxt0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-565"></span><span>       </span><span id="local-6989586621681199628"><span class="annot"><span class="annottext">ictxt1 :: InteractiveContext
</span><a href="#local-6989586621681199628"><span class="hs-identifier hs-var hs-var">ictxt1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Id] -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#extendInteractiveContextWithIds"><span class="hs-identifier hs-var">extendInteractiveContextWithIds</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199629"><span class="hs-identifier hs-var">ictxt0</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199630"><span class="hs-identifier hs-var">final_ids</span></a></span><span>
</span><span id="line-566"></span><span>       </span><span id="local-6989586621681199627"><span class="annot"><span class="annottext">names :: [Name]
</span><a href="#local-6989586621681199627"><span class="hs-identifier hs-var hs-var">names</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Name) -&gt; [Id] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199639"><span class="hs-identifier hs-var">new_ids</span></a></span><span>
</span><span id="line-567"></span><span>       </span><span id="local-6989586621681199625"><span class="annot"><span class="annottext">dl :: DynLinker
</span><a href="#local-6989586621681199625"><span class="hs-identifier hs-var hs-var">dl</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynLinker
</span><a href="GHC.Driver.Types.html#hsc_dynLinker"><span class="hs-identifier hs-var hs-var">hsc_dynLinker</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-568"></span><span>
</span><span id="line-569"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199624"><span class="annot"><span class="annottext">fhvs :: [ForeignHValue]
</span><a href="#local-6989586621681199624"><span class="hs-identifier hs-var hs-var">fhvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Maybe ForeignHValue] -&gt; [ForeignHValue]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe ForeignHValue]
</span><a href="#local-6989586621681199664"><span class="hs-identifier hs-var">mb_hValues</span></a></span><span>
</span><span id="line-570"></span><span>   </span><span class="annot"><span class="annottext">DynLinker -&gt; [(Name, ForeignHValue)] -&gt; IO ()
</span><a href="GHC.Runtime.Linker.html#extendLinkEnv"><span class="hs-identifier hs-var">Linker.extendLinkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker
</span><a href="#local-6989586621681199625"><span class="hs-identifier hs-var">dl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; [ForeignHValue] -&gt; [(Name, ForeignHValue)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199627"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681199624"><span class="hs-identifier hs-var">fhvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-571"></span><span>   </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199632"><span class="hs-identifier hs-var">result_ok</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker -&gt; [(Name, ForeignHValue)] -&gt; IO ()
</span><a href="GHC.Runtime.Linker.html#extendLinkEnv"><span class="hs-identifier hs-var">Linker.extendLinkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker
</span><a href="#local-6989586621681199625"><span class="hs-identifier hs-var">dl</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199636"><span class="hs-identifier hs-var">result_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681199699"><span class="hs-identifier hs-var">apStack_fhv</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-572"></span><span>   </span><span id="local-6989586621681199622"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199622"><span class="hs-identifier hs-var">hsc_env1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
</span><a href="GHC.Runtime.Eval.html#rttiEnvironment"><span class="hs-identifier hs-var">rttiEnvironment</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199628"><span class="hs-identifier hs-var">ictxt1</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-573"></span><span>   </span><span class="annot"><span class="annottext">(HscEnv, [Name], SrcSpan, String)
-&gt; IO (HscEnv, [Name], SrcSpan, String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199622"><span class="hs-identifier hs-var">hsc_env1</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199632"><span class="hs-identifier hs-var">result_ok</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199636"><span class="hs-identifier hs-var">result_name</span></a></span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [Name]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199627"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681199627"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681199679"><span class="hs-identifier hs-var">span</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199677"><span class="hs-identifier hs-var">decl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-574"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-575"></span><span>        </span><span class="hs-comment">-- We need a fresh Unique for each Id we bind, because the linker</span><span>
</span><span id="line-576"></span><span>        </span><span class="hs-comment">-- state is single-threaded and otherwise we'd spam old bindings</span><span>
</span><span id="line-577"></span><span>        </span><span class="hs-comment">-- whenever we stop at a breakpoint.  The InteractveContext is properly</span><span>
</span><span id="line-578"></span><span>        </span><span class="hs-comment">-- saved/restored, but not the linker state.  See #1743, test break026.</span><span>
</span><span id="line-579"></span><span>   </span><span class="annot"><a href="#local-6989586621681199637"><span class="hs-identifier hs-type">mkNewId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-580"></span><span>   </span><span id="local-6989586621681199637"><span class="annot"><span class="annottext">mkNewId :: OccName -&gt; Kind -&gt; Id -&gt; IO Id
</span><a href="#local-6989586621681199637"><span class="hs-identifier hs-var hs-var">mkNewId</span></a></span></span><span> </span><span id="local-6989586621681199620"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681199620"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681199619"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199619"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681199618"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199618"><span class="hs-identifier hs-var">old_id</span></a></span></span><span>
</span><span id="line-581"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681199617"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199617"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; OccName -&gt; SrcSpan -&gt; IO Name
</span><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier hs-var">newInteractiveBinder</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199700"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681199620"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; SrcSpan
forall a. NamedThing a =&gt; a -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#getSrcSpan"><span class="hs-identifier hs-var">getSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199618"><span class="hs-identifier hs-var">old_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-582"></span><span>          </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; IO Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; IdInfo -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobalWithInfo"><span class="hs-identifier hs-var">Id.mkVanillaGlobalWithInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199617"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199619"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Id -&gt; IdInfo
Id -&gt; IdInfo
</span><a href="GHC.Types.Var.html#idInfo"><span class="hs-identifier hs-var">idInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199618"><span class="hs-identifier hs-var">old_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-583"></span><span>
</span><span id="line-584"></span><span>   </span><span class="annot"><a href="#local-6989586621681199653"><span class="hs-identifier hs-type">newTyVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TCvSubst"><span class="hs-identifier hs-type">TCvSubst</span></a></span><span>
</span><span id="line-585"></span><span>     </span><span class="hs-comment">-- Similarly, clone the type variables mentioned in the types</span><span>
</span><span id="line-586"></span><span>     </span><span class="hs-comment">-- we have here, *and* make them all RuntimeUnk tyvars</span><span>
</span><span id="line-587"></span><span>   </span><span id="local-6989586621681199653"><span class="annot"><span class="annottext">newTyVars :: UniqSupply -&gt; [Id] -&gt; TCvSubst
</span><a href="#local-6989586621681199653"><span class="hs-identifier hs-var hs-var">newTyVars</span></a></span></span><span> </span><span id="local-6989586621681199612"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681199612"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span id="local-6989586621681199611"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199611"><span class="hs-identifier hs-var">tvs</span></a></span></span><span>
</span><span id="line-588"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Kind)] -&gt; TCvSubst
</span><a href="GHC.Core.TyCo.Subst.html#mkTvSubstPrs"><span class="hs-identifier hs-var">mkTvSubstPrs</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199609"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Runtime.Eval.html#mkRuntimeUnkTyVar"><span class="hs-identifier hs-var">mkRuntimeUnkTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199608"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199609"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-589"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681199609"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199609"><span class="hs-identifier hs-var">tv</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199606"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681199606"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199611"><span class="hs-identifier hs-var">tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Unique] -&gt; [(Id, Unique)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Unique]
</span><a href="GHC.Types.Unique.Supply.html#uniqsFromSupply"><span class="hs-identifier hs-var">uniqsFromSupply</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681199612"><span class="hs-identifier hs-var">us</span></a></span><span>
</span><span id="line-590"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199608"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681199608"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique -&gt; Name
</span><a href="GHC.Types.Name.html#setNameUnique"><span class="hs-identifier hs-var">setNameUnique</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Var.html#tyVarName"><span class="hs-identifier hs-var">tyVarName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199609"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681199606"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-591"></span><span>
</span><span id="line-592"></span><span>   </span><span id="local-6989586621681199631"><span class="annot"><span class="annottext">isPointer :: Id -&gt; Bool
</span><a href="#local-6989586621681199631"><span class="hs-identifier hs-var hs-var">isPointer</span></a></span></span><span> </span><span id="local-6989586621681199601"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199601"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681199600"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681199600"><span class="hs-identifier hs-var">rep</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; [PrimRep]
Kind -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199601"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-593"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var">isGcPtrRep</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621681199600"><span class="hs-identifier hs-var">rep</span></a></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-594"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-595"></span><span>
</span><span id="line-596"></span><span>   </span><span class="hs-comment">-- Convert unboxed Id's to Nothings</span><span>
</span><span id="line-597"></span><span>   </span><span id="local-6989586621681199673"><span class="annot"><span class="annottext">nullUnboxed :: Maybe (Id, b) -&gt; Maybe (Id, b)
</span><a href="#local-6989586621681199673"><span class="hs-identifier hs-var hs-var">nullUnboxed</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681199597"><span class="annot"><span class="annottext">fv :: (Id, b)
</span><a href="#local-6989586621681199597"><span class="hs-identifier hs-var">fv</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681199596"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199596"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-598"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="#local-6989586621681199631"><span class="hs-identifier hs-var">isPointer</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199596"><span class="hs-identifier hs-var">id</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id, b) -&gt; Maybe (Id, b)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, b)
</span><a href="#local-6989586621681199597"><span class="hs-identifier hs-var">fv</span></a></span><span>
</span><span id="line-599"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, b)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-600"></span><span>   </span><span class="annot"><a href="#local-6989586621681199673"><span class="hs-identifier hs-var">nullUnboxed</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Id, b)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, b)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-601"></span><span>
</span><span id="line-602"></span><span>   </span><span class="hs-comment">-- See Note [Syncing breakpoint info]</span><span>
</span><span id="line-603"></span><span>   </span><span id="local-6989586621681200642"><span id="local-6989586621681200643"><span id="local-6989586621681200644"><span class="annot"><a href="#local-6989586621681199668"><span class="hs-identifier hs-type">syncOccs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681200644"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681200643"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200642"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200644"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200643"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200642"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-604"></span><span>   </span><span id="local-6989586621681199668"><span class="annot"><span class="annottext">syncOccs :: forall a b c. [Maybe (a, b)] -&gt; [c] -&gt; ([a], [b], [c])
</span><a href="#local-6989586621681199668"><span class="hs-identifier hs-var hs-var">syncOccs</span></a></span></span><span> </span><span id="local-6989586621681199595"><span class="annot"><span class="annottext">[Maybe (a, b)]
</span><a href="#local-6989586621681199595"><span class="hs-identifier hs-var">mbVs</span></a></span></span><span> </span><span id="local-6989586621681199594"><span class="annot"><span class="annottext">[c]
</span><a href="#local-6989586621681199594"><span class="hs-identifier hs-var">ocs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(a, b, c)] -&gt; ([a], [b], [c])
forall a b c. [(a, b, c)] -&gt; ([a], [b], [c])
</span><a href="../../base/src/GHC.List.html#unzip3"><span class="hs-identifier hs-var">unzip3</span></a></span><span> </span><span class="annot"><span class="annottext">([(a, b, c)] -&gt; ([a], [b], [c])) -&gt; [(a, b, c)] -&gt; ([a], [b], [c])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (a, b, c)] -&gt; [(a, b, c)]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">([Maybe (a, b, c)] -&gt; [(a, b, c)])
-&gt; [Maybe (a, b, c)] -&gt; [(a, b, c)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (a, b)] -&gt; [c] -&gt; [Maybe (a, b, c)]
forall a b c. [Maybe (a, b)] -&gt; [c] -&gt; [Maybe (a, b, c)]
</span><a href="#local-6989586621681199592"><span class="hs-identifier hs-var">joinOccs</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (a, b)]
</span><a href="#local-6989586621681199595"><span class="hs-identifier hs-var">mbVs</span></a></span><span> </span><span class="annot"><span class="annottext">[c]
</span><a href="#local-6989586621681199594"><span class="hs-identifier hs-var">ocs</span></a></span><span>
</span><span id="line-605"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-606"></span><span>       </span><span id="local-6989586621681200606"><span id="local-6989586621681200607"><span id="local-6989586621681200608"><span class="annot"><a href="#local-6989586621681199592"><span class="hs-identifier hs-type">joinOccs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681200608"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681200607"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200606"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681200608"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681200607"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681200606"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span></span></span><span>
</span><span id="line-607"></span><span>       </span><span id="local-6989586621681199592"><span class="annot"><span class="annottext">joinOccs :: forall a b c. [Maybe (a, b)] -&gt; [c] -&gt; [Maybe (a, b, c)]
</span><a href="#local-6989586621681199592"><span class="hs-identifier hs-var hs-var">joinOccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; (Maybe (a, b) -&gt; c -&gt; Maybe (a, b, c))
-&gt; [Maybe (a, b)]
-&gt; [c]
-&gt; [Maybe (a, b, c)]
forall a b c. String -&gt; (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="GHC.Utils.Misc.html#zipWithEqual"><span class="hs-identifier hs-var">zipWithEqual</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;bindLocalsAtBreakpoint&quot;</span></span><span> </span><span class="annot"><span class="annottext">Maybe (a, b) -&gt; c -&gt; Maybe (a, b, c)
forall {f :: * -&gt; *} {a} {b} {a}.
Applicative f =&gt;
f (a, b) -&gt; a -&gt; f (a, b, a)
</span><a href="#local-6989586621681199588"><span class="hs-identifier hs-var">joinOcc</span></a></span><span>
</span><span id="line-608"></span><span>       </span><span id="local-6989586621681199588"><span class="annot"><span class="annottext">joinOcc :: f (a, b) -&gt; a -&gt; f (a, b, a)
</span><a href="#local-6989586621681199588"><span class="hs-identifier hs-var hs-var">joinOcc</span></a></span></span><span> </span><span id="local-6989586621681199581"><span class="annot"><span class="annottext">f (a, b)
</span><a href="#local-6989586621681199581"><span class="hs-identifier hs-var">mbV</span></a></span></span><span> </span><span id="local-6989586621681199580"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199580"><span class="hs-identifier hs-var">oc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681199579"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199579"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681199578"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681199578"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681199577"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199577"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199579"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681199578"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199577"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((a, b) -&gt; a -&gt; (a, b, a)) -&gt; f (a, b) -&gt; f (a -&gt; (a, b, a))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f (a, b)
</span><a href="#local-6989586621681199581"><span class="hs-identifier hs-var">mbV</span></a></span><span> </span><span class="annot"><span class="annottext">f (a -&gt; (a, b, a)) -&gt; f a -&gt; f (a, b, a)
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; f a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199580"><span class="hs-identifier hs-var">oc</span></a></span><span>
</span><span id="line-609"></span><span>
</span><span id="line-610"></span><span class="annot"><a href="GHC.Runtime.Eval.html#rttiEnvironment"><span class="hs-identifier hs-type">rttiEnvironment</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-611"></span><span id="rttiEnvironment"><span class="annot"><span class="annottext">rttiEnvironment :: HscEnv -&gt; IO HscEnv
</span><a href="GHC.Runtime.Eval.html#rttiEnvironment"><span class="hs-identifier hs-var hs-var">rttiEnvironment</span></a></span></span><span> </span><span id="local-6989586621681199576"><span class="annot"><span class="annottext">hsc_env :: HscEnv
</span><a href="#local-6989586621681199576"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_IC :: HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681199574"><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199574"><span class="hs-identifier hs-var">ic</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-612"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199573"><span class="annot"><span class="annottext">tmp_ids :: [Id]
</span><a href="#local-6989586621681199573"><span class="hs-identifier hs-var hs-var">tmp_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199572"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AnId"><span class="hs-identifier hs-type">AnId</span></a></span><span> </span><span id="local-6989586621681199572"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199572"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#ic_tythings"><span class="hs-identifier hs-var hs-var">ic_tythings</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199574"><span class="hs-identifier hs-var">ic</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-613"></span><span>       </span><span id="local-6989586621681199568"><span class="annot"><span class="annottext">incompletelyTypedIds :: [Id]
</span><a href="#local-6989586621681199568"><span class="hs-identifier hs-var hs-var">incompletelyTypedIds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-614"></span><span>           </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199567"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681199567"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199567"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199573"><span class="hs-identifier hs-var">tmp_ids</span></a></span><span>
</span><span id="line-615"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="#local-6989586621681199566"><span class="hs-identifier hs-var">noSkolems</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199567"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-616"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span class="annot"><span class="annottext">(OccName -&gt; FastString) -&gt; (Id -&gt; OccName) -&gt; Id -&gt; FastString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span class="annot"><span class="annottext">(Name -&gt; OccName) -&gt; (Id -&gt; Name) -&gt; Id -&gt; OccName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199567"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="GHC.Runtime.Eval.html#result_fs"><span class="hs-identifier hs-var">result_fs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-617"></span><span>   </span><span id="local-6989586621681199563"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199563"><span class="hs-identifier hs-var">hsc_env'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; Name -&gt; IO HscEnv) -&gt; HscEnv -&gt; [Name] -&gt; IO HscEnv
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Name -&gt; IO HscEnv
</span><a href="#local-6989586621681199561"><span class="hs-identifier hs-var">improveTypes</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199576"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Name) -&gt; [Id] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199568"><span class="hs-identifier hs-var">incompletelyTypedIds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-618"></span><span>   </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199563"><span class="hs-identifier hs-var">hsc_env'</span></a></span><span>
</span><span id="line-619"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-620"></span><span>     </span><span id="local-6989586621681199566"><span class="annot"><span class="annottext">noSkolems :: Id -&gt; Bool
</span><a href="#local-6989586621681199566"><span class="hs-identifier hs-var hs-var">noSkolems</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Bool
</span><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfType"><span class="hs-identifier hs-var">noFreeVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Bool) -&gt; (Id -&gt; Kind) -&gt; Id -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span>
</span><span id="line-621"></span><span>     </span><span id="local-6989586621681199561"><span class="annot"><span class="annottext">improveTypes :: HscEnv -&gt; Name -&gt; IO HscEnv
</span><a href="#local-6989586621681199561"><span class="hs-identifier hs-var hs-var">improveTypes</span></a></span></span><span> </span><span id="local-6989586621681199547"><span class="annot"><span class="annottext">hsc_env :: HscEnv
</span><a href="#local-6989586621681199547"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_IC :: HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681199546"><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199546"><span class="hs-identifier hs-var">ic</span></a></span></span><span class="hs-special">}</span><span> </span><span id="local-6989586621681199545"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199545"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-622"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199544"><span class="annot"><span class="annottext">tmp_ids :: [Id]
</span><a href="#local-6989586621681199544"><span class="hs-identifier hs-var hs-var">tmp_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199543"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AnId"><span class="hs-identifier hs-type">AnId</span></a></span><span> </span><span id="local-6989586621681199543"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199543"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#ic_tythings"><span class="hs-identifier hs-var hs-var">ic_tythings</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199546"><span class="hs-identifier hs-var">ic</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-623"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199540"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199540"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; Maybe Id
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Maybe a
</span><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier hs-var">find</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681199539"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199539"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199539"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199545"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199544"><span class="hs-identifier hs-var">tmp_ids</span></a></span><span>
</span><span id="line-624"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="#local-6989586621681199566"><span class="hs-identifier hs-var">noSkolems</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199540"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-625"></span><span>         </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199547"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-626"></span><span>         </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-627"></span><span>           </span><span id="local-6989586621681199538"><span class="annot"><span class="annottext">Maybe Kind
</span><a href="#local-6989586621681199538"><span class="hs-identifier hs-var">mb_new_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Int -&gt; Id -&gt; IO (Maybe Kind)
</span><a href="GHC.Runtime.Eval.html#reconstructType"><span class="hs-identifier hs-var">reconstructType</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199547"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199540"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-628"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199537"><span class="annot"><span class="annottext">old_ty :: Kind
</span><a href="#local-6989586621681199537"><span class="hs-identifier hs-var hs-var">old_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199540"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-629"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Kind
</span><a href="#local-6989586621681199538"><span class="hs-identifier hs-var">mb_new_ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-630"></span><span>             </span><span class="annot"><span class="annottext">Maybe Kind
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199547"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-631"></span><span>             </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199536"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199536"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-632"></span><span>              </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Kind -&gt; Kind -&gt; Maybe TCvSubst
</span><a href="GHC.Runtime.Heap.Inspect.html#improveRTTIType"><span class="hs-identifier hs-var">improveRTTIType</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199547"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199537"><span class="hs-identifier hs-var">old_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199536"><span class="hs-identifier hs-var">new_ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-633"></span><span>               </span><span class="annot"><span class="annottext">Maybe TCvSubst
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; IO HscEnv) -&gt; HscEnv -&gt; IO HscEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-634"></span><span>                        </span><span class="hs-identifier">WARN</span><span class="hs-special">(</span><span class="hs-identifier">True</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">text</span><span> </span><span class="hs-special">(</span><span class="hs-string">&quot;:print failed to calculate the &quot;</span><span>
</span><span id="line-635"></span><span>                                           </span><span class="hs-operator">++</span><span> </span><span class="hs-string">&quot;improvement for a type&quot;</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">hsc_env</span><span>
</span><span id="line-636"></span><span>               </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199533"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199533"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-637"></span><span>                 </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199532"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681199532"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199547"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-638"></span><span>                 </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681199532"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_rtti"><span class="hs-identifier hs-var">Opt_D_dump_rtti</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RTTI&quot;</span></span><span>
</span><span id="line-639"></span><span>                   </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatText"><span class="hs-identifier hs-var">FormatText</span></a></span><span>
</span><span id="line-640"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RTTI Improvement for&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199540"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#equals"><span class="hs-identifier hs-var">equals</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-641"></span><span>                          </span><span class="annot"><span class="annottext">TCvSubst -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199533"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span>                 </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199525"><span class="annot"><span class="annottext">ic' :: InteractiveContext
</span><a href="#local-6989586621681199525"><span class="hs-identifier hs-var hs-var">ic'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; TCvSubst -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#substInteractiveContext"><span class="hs-identifier hs-var">substInteractiveContext</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199546"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199533"><span class="hs-identifier hs-var">subst</span></a></span><span>
</span><span id="line-644"></span><span>                 </span><span class="annot"><span class="annottext">HscEnv -&gt; IO HscEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199547"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199525"><span class="hs-identifier hs-var">ic'</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span class="annot"><a href="GHC.Runtime.Eval.html#pushResume"><span class="hs-identifier hs-type">pushResume</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.Types.html#Resume"><span class="hs-identifier hs-type">Resume</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-647"></span><span id="pushResume"><span class="annot"><span class="annottext">pushResume :: HscEnv -&gt; Resume -&gt; HscEnv
</span><a href="GHC.Runtime.Eval.html#pushResume"><span class="hs-identifier hs-var hs-var">pushResume</span></a></span></span><span> </span><span id="local-6989586621681199523"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199523"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681199522"><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199522"><span class="hs-identifier hs-var">resume</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199523"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199521"><span class="hs-identifier hs-var">ictxt1</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-648"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-649"></span><span>        </span><span id="local-6989586621681199520"><span class="annot"><span class="annottext">ictxt0 :: InteractiveContext
</span><a href="#local-6989586621681199520"><span class="hs-identifier hs-var hs-var">ictxt0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199523"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-650"></span><span>        </span><span id="local-6989586621681199521"><span class="annot"><span class="annottext">ictxt1 :: InteractiveContext
</span><a href="#local-6989586621681199521"><span class="hs-identifier hs-var hs-var">ictxt1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199520"><span class="hs-identifier hs-var">ictxt0</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_resume :: [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var">ic_resume</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199522"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="annot"><span class="annottext">Resume -&gt; [Resume] -&gt; [Resume]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var hs-var">ic_resume</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199520"><span class="hs-identifier hs-var">ictxt0</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-651"></span><span>
</span><span id="line-652"></span><span>
</span><span id="line-653"></span><span>  </span><span class="hs-comment">{-
  Note [Syncing breakpoint info]

  To display the values of the free variables for a single breakpoint, the
  function `GHC.Runtime.Eval.bindLocalsAtBreakpoint` pulls
  out the information from the fields `modBreaks_breakInfo` and
  `modBreaks_vars` of the `ModBreaks` data structure.
  For a specific breakpoint this gives 2 lists of type `Id` (or `Var`)
  and `OccName`.
  They are used to create the Id's for the free variables and must be kept
  in sync!

  There are 3 situations where items are removed from the Id list
  (or replaced with `Nothing`):
  1.) If function `GHC.CoreToByteCode.schemeER_wrk` (which creates
      the Id list) doesn't find an Id in the ByteCode environement.
  2.) If function `GHC.Runtime.Eval.bindLocalsAtBreakpoint`
      filters out unboxed elements from the Id list, because GHCi cannot
      yet handle them.
  3.) If the GHCi interpreter doesn't find the reference to a free variable
      of our breakpoint. This also happens in the function
      bindLocalsAtBreakpoint.

  If an element is removed from the Id list, then the corresponding element
  must also be removed from the Occ list. Otherwise GHCi will confuse
  variable names as in #8487.
  -}</span><span>
</span><span id="line-680"></span><span>
</span><span id="line-681"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-682"></span><span class="hs-comment">-- Abandoning a resume context</span><span>
</span><span id="line-683"></span><span>
</span><span id="line-684"></span><span id="local-6989586621681200580"><span class="annot"><a href="GHC.Runtime.Eval.html#abandon"><span class="hs-identifier hs-type">abandon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200580"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200580"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-685"></span><span id="abandon"><span class="annot"><span class="annottext">abandon :: forall (m :: * -&gt; *). GhcMonad m =&gt; m Bool
</span><a href="GHC.Runtime.Eval.html#abandon"><span class="hs-identifier hs-var hs-var">abandon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-686"></span><span>   </span><span id="local-6989586621681199505"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199505"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-687"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199504"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681199504"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199505"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-688"></span><span>       </span><span id="local-6989586621681199503"><span class="annot"><span class="annottext">resume :: [Resume]
</span><a href="#local-6989586621681199503"><span class="hs-identifier hs-var hs-var">resume</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var hs-var">ic_resume</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199504"><span class="hs-identifier hs-var">ic</span></a></span><span>
</span><span id="line-689"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199503"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-690"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-691"></span><span>      </span><span id="local-6989586621681199502"><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199502"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681199501"><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199501"><span class="hs-identifier hs-var">rs</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-692"></span><span>         </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199505"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199504"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_resume :: [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var">ic_resume</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199501"><span class="hs-identifier hs-var">rs</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-693"></span><span>         </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignRef (ResumeContext [HValueRef]) -&gt; IO ()
</span><a href="GHC.Runtime.Interpreter.html#abandonStmt"><span class="hs-identifier hs-var">abandonStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199505"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Resume -&gt; ForeignRef (ResumeContext [HValueRef])
</span><a href="GHC.Runtime.Eval.Types.html#resumeContext"><span class="hs-identifier hs-var hs-var">resumeContext</span></a></span><span> </span><span class="annot"><span class="annottext">Resume
</span><a href="#local-6989586621681199502"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-694"></span><span>         </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span id="local-6989586621681199499"><span class="annot"><a href="GHC.Runtime.Eval.html#abandonAll"><span class="hs-identifier hs-type">abandonAll</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681199499"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681199499"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-697"></span><span id="abandonAll"><span class="annot"><span class="annottext">abandonAll :: forall (m :: * -&gt; *). GhcMonad m =&gt; m Bool
</span><a href="GHC.Runtime.Eval.html#abandonAll"><span class="hs-identifier hs-var hs-var">abandonAll</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-698"></span><span>   </span><span id="local-6989586621681199482"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199482"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-699"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199481"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681199481"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199482"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-700"></span><span>       </span><span id="local-6989586621681199480"><span class="annot"><span class="annottext">resume :: [Resume]
</span><a href="#local-6989586621681199480"><span class="hs-identifier hs-var hs-var">resume</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var hs-var">ic_resume</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199481"><span class="hs-identifier hs-var">ic</span></a></span><span>
</span><span id="line-701"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199480"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-702"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">]</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-703"></span><span>      </span><span id="local-6989586621681199479"><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199479"><span class="hs-identifier hs-var">rs</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-704"></span><span>         </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199482"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199481"><span class="hs-identifier hs-var">ic</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_resume :: [Resume]
</span><a href="GHC.Driver.Types.html#ic_resume"><span class="hs-identifier hs-var">ic_resume</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-705"></span><span>         </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Resume -&gt; IO ()) -&gt; [Resume] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignRef (ResumeContext [HValueRef]) -&gt; IO ()
</span><a href="GHC.Runtime.Interpreter.html#abandonStmt"><span class="hs-identifier hs-var">abandonStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199482"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="annot"><span class="annottext">(ForeignRef (ResumeContext [HValueRef]) -&gt; IO ())
-&gt; (Resume -&gt; ForeignRef (ResumeContext [HValueRef]))
-&gt; Resume
-&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Resume -&gt; ForeignRef (ResumeContext [HValueRef])
</span><a href="GHC.Runtime.Eval.Types.html#resumeContext"><span class="hs-identifier hs-var hs-var">resumeContext</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Resume]
</span><a href="#local-6989586621681199479"><span class="hs-identifier hs-var">rs</span></a></span><span>
</span><span id="line-706"></span><span>         </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-707"></span><span>
</span><span id="line-708"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-709"></span><span class="hs-comment">-- Bounded list, optimised for repeated cons</span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span class="hs-keyword">data</span><span> </span><span id="BoundedList"><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-var">BoundedList</span></a></span></span><span> </span><span id="local-6989586621681200572"><span class="annot"><a href="#local-6989586621681200572"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="BL"><span class="annot"><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-var">BL</span></a></span></span><span>
</span><span id="line-712"></span><span>                        </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>  </span><span class="hs-comment">-- length</span><span>
</span><span id="line-713"></span><span>                        </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>  </span><span class="hs-comment">-- bound</span><span>
</span><span id="line-714"></span><span>                        </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200572"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- left</span><span>
</span><span id="line-715"></span><span>                        </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200572"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- right,  list is (left ++ reverse right)</span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span id="local-6989586621681200696"><span class="annot"><a href="GHC.Runtime.Eval.html#nilBL"><span class="hs-identifier hs-type">nilBL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-type">BoundedList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200696"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-718"></span><span id="nilBL"><span class="annot"><span class="annottext">nilBL :: forall a. Int -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#nilBL"><span class="hs-identifier hs-var hs-var">nilBL</span></a></span></span><span> </span><span id="local-6989586621681199476"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199476"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
forall a. Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-var">BL</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199476"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-719"></span><span>
</span><span id="line-720"></span><span id="local-6989586621681200682"><span class="annot"><a href="GHC.Runtime.Eval.html#consBL"><span class="hs-identifier hs-type">consBL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681200682"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-type">BoundedList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200682"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-type">BoundedList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200682"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-721"></span><span id="consBL"><span class="annot"><span class="annottext">consBL :: forall a. a -&gt; BoundedList a -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#consBL"><span class="hs-identifier hs-var hs-var">consBL</span></a></span></span><span> </span><span id="local-6989586621681199471"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199471"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-type">BL</span></a></span><span> </span><span id="local-6989586621681199470"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199470"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span id="local-6989586621681199469"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199469"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621681199468"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199468"><span class="hs-identifier hs-var">left</span></a></span></span><span> </span><span id="local-6989586621681199467"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199467"><span class="hs-identifier hs-var">right</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-722"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199470"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199469"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
forall a. Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-var">BL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199470"><span class="hs-identifier hs-var">len</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199469"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199471"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199468"><span class="hs-identifier hs-var">left</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199467"><span class="hs-identifier hs-var">right</span></a></span><span>
</span><span id="line-723"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199467"><span class="hs-identifier hs-var">right</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
forall a. Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-var">BL</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199470"><span class="hs-identifier hs-var">len</span></a></span><span>     </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199469"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199471"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">]</span><span>      </span><span class="annot"><span class="annottext">([a] -&gt; BoundedList a) -&gt; [a] -&gt; BoundedList a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199468"><span class="hs-identifier hs-var">left</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-724"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
forall a. Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-var">BL</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199470"><span class="hs-identifier hs-var">len</span></a></span><span>     </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199469"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199471"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199468"><span class="hs-identifier hs-var">left</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([a] -&gt; BoundedList a) -&gt; [a] -&gt; BoundedList a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199467"><span class="hs-identifier hs-var">right</span></a></span><span>
</span><span id="line-725"></span><span>
</span><span id="line-726"></span><span id="local-6989586621681200681"><span class="annot"><a href="GHC.Runtime.Eval.html#toListBL"><span class="hs-identifier hs-type">toListBL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-type">BoundedList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200681"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200681"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-727"></span><span id="toListBL"><span class="annot"><span class="annottext">toListBL :: forall a. BoundedList a -&gt; [a]
</span><a href="GHC.Runtime.Eval.html#toListBL"><span class="hs-identifier hs-var hs-var">toListBL</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-type">BL</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681199462"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199462"><span class="hs-identifier hs-var">left</span></a></span></span><span> </span><span id="local-6989586621681199461"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199461"><span class="hs-identifier hs-var">right</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199462"><span class="hs-identifier hs-var">left</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199461"><span class="hs-identifier hs-var">right</span></a></span><span>
</span><span id="line-728"></span><span>
</span><span id="line-729"></span><span id="local-6989586621681200669"><span class="annot"><a href="GHC.Runtime.Eval.html#fromListBL"><span class="hs-identifier hs-type">fromListBL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681200669"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#BoundedList"><span class="hs-identifier hs-type">BoundedList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200669"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-730"></span><span id="fromListBL"><span class="annot"><span class="annottext">fromListBL :: forall a. Int -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#fromListBL"><span class="hs-identifier hs-var hs-var">fromListBL</span></a></span></span><span> </span><span id="local-6989586621681199459"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199459"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621681199458"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199458"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
forall a. Int -&gt; Int -&gt; [a] -&gt; [a] -&gt; BoundedList a
</span><a href="GHC.Runtime.Eval.html#BL"><span class="hs-identifier hs-var">BL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199458"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681199459"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681199458"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-731"></span><span>
</span><span id="line-732"></span><span class="hs-comment">-- lenBL (BL len _ _ _) = len</span><span>
</span><span id="line-733"></span><span>
</span><span id="line-734"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-735"></span><span class="hs-comment">-- | Set the interactive evaluation context.</span><span>
</span><span id="line-736"></span><span class="hs-comment">--</span><span>
</span><span id="line-737"></span><span class="hs-comment">-- (setContext imports) sets the ic_imports field (which in turn</span><span>
</span><span id="line-738"></span><span class="hs-comment">-- determines what is in scope at the prompt) to 'imports', and</span><span>
</span><span id="line-739"></span><span class="hs-comment">-- constructs the ic_rn_glb_env environment to reflect it.</span><span>
</span><span id="line-740"></span><span class="hs-comment">--</span><span>
</span><span id="line-741"></span><span class="hs-comment">-- We retain in scope all the things defined at the prompt, and kept</span><span>
</span><span id="line-742"></span><span class="hs-comment">-- in ic_tythings.  (Indeed, they shadow stuff from ic_imports.)</span><span>
</span><span id="line-743"></span><span>
</span><span id="line-744"></span><span id="local-6989586621681200565"><span class="annot"><a href="GHC.Runtime.Eval.html#setContext"><span class="hs-identifier hs-type">setContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200565"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#InteractiveImport"><span class="hs-identifier hs-type">InteractiveImport</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200565"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-745"></span><span id="setContext"><span class="annot"><span class="annottext">setContext :: forall (m :: * -&gt; *). GhcMonad m =&gt; [InteractiveImport] -&gt; m ()
</span><a href="GHC.Runtime.Eval.html#setContext"><span class="hs-identifier hs-var hs-var">setContext</span></a></span></span><span> </span><span id="local-6989586621681199442"><span class="annot"><span class="annottext">[InteractiveImport]
</span><a href="#local-6989586621681199442"><span class="hs-identifier hs-var">imports</span></a></span></span><span>
</span><span id="line-746"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681199441"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199441"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-747"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199440"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681199440"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199441"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-748"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681199439"><span class="annot"><span class="annottext">Either (ModuleName, String) GlobalRdrEnv
</span><a href="#local-6989586621681199439"><span class="hs-identifier hs-var">all_env_err</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Either (ModuleName, String) GlobalRdrEnv)
-&gt; m (Either (ModuleName, String) GlobalRdrEnv)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Either (ModuleName, String) GlobalRdrEnv)
 -&gt; m (Either (ModuleName, String) GlobalRdrEnv))
-&gt; IO (Either (ModuleName, String) GlobalRdrEnv)
-&gt; m (Either (ModuleName, String) GlobalRdrEnv)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; [InteractiveImport]
-&gt; IO (Either (ModuleName, String) GlobalRdrEnv)
</span><a href="GHC.Runtime.Eval.html#findGlobalRdrEnv"><span class="hs-identifier hs-var">findGlobalRdrEnv</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199441"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">[InteractiveImport]
</span><a href="#local-6989586621681199442"><span class="hs-identifier hs-var">imports</span></a></span><span>
</span><span id="line-749"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either (ModuleName, String) GlobalRdrEnv
</span><a href="#local-6989586621681199439"><span class="hs-identifier hs-var">all_env_err</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-750"></span><span>           </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681199437"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199437"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199436"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199436"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-751"></span><span>               </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO ()
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; String -&gt; GhcException
forall {a}. Outputable a =&gt; DynFlags -&gt; a -&gt; String -&gt; GhcException
</span><a href="#local-6989586621681199435"><span class="hs-identifier hs-var">formatError</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681199440"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199437"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199436"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-752"></span><span>           </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681199434"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199434"><span class="hs-identifier hs-var">all_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-753"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199433"><span class="annot"><span class="annottext">old_ic :: InteractiveContext
</span><a href="#local-6989586621681199433"><span class="hs-identifier hs-var hs-var">old_ic</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199441"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-754"></span><span>             </span><span class="hs-glyph">!</span><span id="local-6989586621681199432"><span class="annot"><span class="annottext">final_rdr_env :: GlobalRdrEnv
</span><a href="#local-6989586621681199432"><span class="hs-identifier hs-var hs-var">final_rdr_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199434"><span class="hs-identifier hs-var">all_env</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [TyThing] -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#icExtendGblRdrEnv"><span class="hs-operator hs-var">`icExtendGblRdrEnv`</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#ic_tythings"><span class="hs-identifier hs-var hs-var">ic_tythings</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199433"><span class="hs-identifier hs-var">old_ic</span></a></span><span>
</span><span id="line-755"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span>
</span><span id="line-756"></span><span>         </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199441"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199433"><span class="hs-identifier hs-var">old_ic</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ic_imports :: [InteractiveImport]
</span><a href="GHC.Driver.Types.html#ic_imports"><span class="hs-identifier hs-var">ic_imports</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InteractiveImport]
</span><a href="#local-6989586621681199442"><span class="hs-identifier hs-var">imports</span></a></span><span>
</span><span id="line-757"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ic_rn_gbl_env :: GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#ic_rn_gbl_env"><span class="hs-identifier hs-var">ic_rn_gbl_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199432"><span class="hs-identifier hs-var">final_rdr_env</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-758"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-759"></span><span>    </span><span id="local-6989586621681199435"><span class="annot"><span class="annottext">formatError :: DynFlags -&gt; a -&gt; String -&gt; GhcException
</span><a href="#local-6989586621681199435"><span class="hs-identifier hs-var hs-var">formatError</span></a></span></span><span> </span><span id="local-6989586621681199427"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681199427"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681199426"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199426"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681199425"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199425"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; GhcException)
-&gt; (MsgDoc -&gt; String) -&gt; MsgDoc -&gt; GhcException
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; String
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681199427"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; GhcException) -&gt; MsgDoc -&gt; GhcException
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-760"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Cannot add module&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681199426"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-761"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;to context:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199425"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-762"></span><span>
</span><span id="line-763"></span><span class="annot"><a href="GHC.Runtime.Eval.html#findGlobalRdrEnv"><span class="hs-identifier hs-type">findGlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#InteractiveImport"><span class="hs-identifier hs-type">InteractiveImport</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-764"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-765"></span><span class="hs-comment">-- Compute the GlobalRdrEnv for the interactive context</span><span>
</span><span id="line-766"></span><span id="findGlobalRdrEnv"><span class="annot"><span class="annottext">findGlobalRdrEnv :: HscEnv
-&gt; [InteractiveImport]
-&gt; IO (Either (ModuleName, String) GlobalRdrEnv)
</span><a href="GHC.Runtime.Eval.html#findGlobalRdrEnv"><span class="hs-identifier hs-var hs-var">findGlobalRdrEnv</span></a></span></span><span> </span><span id="local-6989586621681199422"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199422"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681199421"><span class="annot"><span class="annottext">[InteractiveImport]
</span><a href="#local-6989586621681199421"><span class="hs-identifier hs-var">imports</span></a></span></span><span>
</span><span id="line-767"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681199420"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199420"><span class="hs-identifier hs-var">idecls_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; [LImportDecl GhcPs] -&gt; IO GlobalRdrEnv
</span><a href="GHC.Driver.Main.html#hscRnImportDecls"><span class="hs-identifier hs-var">hscRnImportDecls</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199422"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681199418"><span class="hs-identifier hs-var">idecls</span></a></span><span>
</span><span id="line-768"></span><span>                    </span><span class="hs-comment">-- This call also loads any orphan modules</span><span>
</span><span id="line-769"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Either (ModuleName, String) GlobalRdrEnv
-&gt; IO (Either (ModuleName, String) GlobalRdrEnv)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either (ModuleName, String) GlobalRdrEnv
 -&gt; IO (Either (ModuleName, String) GlobalRdrEnv))
-&gt; Either (ModuleName, String) GlobalRdrEnv
-&gt; IO (Either (ModuleName, String) GlobalRdrEnv)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Either (ModuleName, String) GlobalRdrEnv]
-&gt; ([(ModuleName, String)], [GlobalRdrEnv])
forall a b. [Either a b] -&gt; ([a], [b])
</span><a href="../../base/src/Data.Either.html#partitionEithers"><span class="hs-identifier hs-var">partitionEithers</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ModuleName -&gt; Either (ModuleName, String) GlobalRdrEnv)
-&gt; [ModuleName] -&gt; [Either (ModuleName, String) GlobalRdrEnv]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; Either (ModuleName, String) GlobalRdrEnv
</span><a href="#local-6989586621681199416"><span class="hs-identifier hs-var">mkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681199415"><span class="hs-identifier hs-var">imods</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-770"></span><span>           </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199414"><span class="annot"><span class="annottext">[GlobalRdrEnv]
</span><a href="#local-6989586621681199414"><span class="hs-identifier hs-var">imods_env</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; Either (ModuleName, String) GlobalRdrEnv
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; GlobalRdrEnv -&gt; GlobalRdrEnv)
-&gt; GlobalRdrEnv -&gt; [GlobalRdrEnv] -&gt; GlobalRdrEnv
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; GlobalRdrEnv -&gt; GlobalRdrEnv
</span><a href="GHC.Types.Name.Reader.html#plusGlobalRdrEnv"><span class="hs-identifier hs-var">plusGlobalRdrEnv</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199420"><span class="hs-identifier hs-var">idecls_env</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrEnv]
</span><a href="#local-6989586621681199414"><span class="hs-identifier hs-var">imods_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-771"></span><span>           </span><span class="hs-special">(</span><span id="local-6989586621681199411"><span class="annot"><span class="annottext">(ModuleName, String)
</span><a href="#local-6989586621681199411"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, String)]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrEnv]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(ModuleName, String) -&gt; Either (ModuleName, String) GlobalRdrEnv
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">(ModuleName, String)
</span><a href="#local-6989586621681199411"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-772"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-773"></span><span>    </span><span class="annot"><a href="#local-6989586621681199418"><span class="hs-identifier hs-type">idecls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LImportDecl"><span class="hs-identifier hs-type">LImportDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-774"></span><span>    </span><span id="local-6989586621681199418"><span class="annot"><span class="annottext">idecls :: [LImportDecl GhcPs]
</span><a href="#local-6989586621681199418"><span class="hs-identifier hs-var hs-var">idecls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ImportDecl GhcPs -&gt; LImportDecl GhcPs
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">ImportDecl GhcPs
</span><a href="#local-6989586621681199409"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#IIDecl"><span class="hs-identifier hs-type">IIDecl</span></a></span><span> </span><span id="local-6989586621681199409"><span class="annot"><span class="annottext">ImportDecl GhcPs
</span><a href="#local-6989586621681199409"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[InteractiveImport]
</span><a href="#local-6989586621681199421"><span class="hs-identifier hs-var">imports</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>    </span><span class="annot"><a href="#local-6989586621681199415"><span class="hs-identifier hs-type">imods</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-777"></span><span>    </span><span id="local-6989586621681199415"><span class="annot"><span class="annottext">imods :: [ModuleName]
</span><a href="#local-6989586621681199415"><span class="hs-identifier hs-var hs-var">imods</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199407"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#IIModule"><span class="hs-identifier hs-type">IIModule</span></a></span><span> </span><span id="local-6989586621681199407"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199407"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[InteractiveImport]
</span><a href="#local-6989586621681199421"><span class="hs-identifier hs-var">imports</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-778"></span><span>
</span><span id="line-779"></span><span>    </span><span id="local-6989586621681199416"><span class="annot"><span class="annottext">mkEnv :: ModuleName -&gt; Either (ModuleName, String) GlobalRdrEnv
</span><a href="#local-6989586621681199416"><span class="hs-identifier hs-var hs-var">mkEnv</span></a></span></span><span> </span><span id="local-6989586621681199405"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199405"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Either String GlobalRdrEnv
</span><a href="GHC.Runtime.Eval.html#mkTopLevEnv"><span class="hs-identifier hs-var">mkTopLevEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199422"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199405"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-780"></span><span>      </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681199403"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199403"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(ModuleName, String) -&gt; Either (ModuleName, String) GlobalRdrEnv
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199405"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199403"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-781"></span><span>      </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681199402"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199402"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; Either (ModuleName, String) GlobalRdrEnv
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199402"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-782"></span><span>
</span><span id="line-783"></span><span class="annot"><a href="GHC.Runtime.Eval.html#availsToGlobalRdrEnv"><span class="hs-identifier hs-type">availsToGlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Avail.html#AvailInfo"><span class="hs-identifier hs-type">AvailInfo</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span>
</span><span id="line-784"></span><span id="availsToGlobalRdrEnv"><span class="annot"><span class="annottext">availsToGlobalRdrEnv :: ModuleName -&gt; [AvailInfo] -&gt; GlobalRdrEnv
</span><a href="GHC.Runtime.Eval.html#availsToGlobalRdrEnv"><span class="hs-identifier hs-var hs-var">availsToGlobalRdrEnv</span></a></span></span><span> </span><span id="local-6989586621681199401"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199401"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621681199400"><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681199400"><span class="hs-identifier hs-var">avails</span></a></span></span><span>
</span><span id="line-785"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; GlobalRdrEnv
</span><a href="GHC.Types.Name.Reader.html#mkGlobalRdrEnv"><span class="hs-identifier hs-var">mkGlobalRdrEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ImportSpec -&gt; [AvailInfo] -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#gresFromAvails"><span class="hs-identifier hs-var">gresFromAvails</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportSpec -&gt; Maybe ImportSpec
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681199397"><span class="hs-identifier hs-var">imp_spec</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681199400"><span class="hs-identifier hs-var">avails</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-786"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-787"></span><span>      </span><span class="hs-comment">-- We're building a GlobalRdrEnv as if the user imported</span><span>
</span><span id="line-788"></span><span>      </span><span class="hs-comment">-- all the specified modules into the global interactive module</span><span>
</span><span id="line-789"></span><span>    </span><span id="local-6989586621681199397"><span class="annot"><span class="annottext">imp_spec :: ImportSpec
</span><a href="#local-6989586621681199397"><span class="hs-identifier hs-var hs-var">imp_spec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImpSpec :: ImpDeclSpec -&gt; ImpItemSpec -&gt; ImportSpec
</span><a href="GHC.Types.Name.Reader.html#ImpSpec"><span class="hs-identifier hs-type">ImpSpec</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">is_decl :: ImpDeclSpec
</span><a href="GHC.Types.Name.Reader.html#is_decl"><span class="hs-identifier hs-var">is_decl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681199394"><span class="hs-identifier hs-var">decl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">is_item :: ImpItemSpec
</span><a href="GHC.Types.Name.Reader.html#is_item"><span class="hs-identifier hs-var">is_item</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImpItemSpec
</span><a href="GHC.Types.Name.Reader.html#ImpAll"><span class="hs-identifier hs-var">ImpAll</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-790"></span><span>    </span><span id="local-6989586621681199394"><span class="annot"><span class="annottext">decl :: ImpDeclSpec
</span><a href="#local-6989586621681199394"><span class="hs-identifier hs-var hs-var">decl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec :: ModuleName -&gt; ModuleName -&gt; Bool -&gt; SrcSpan -&gt; ImpDeclSpec
</span><a href="GHC.Types.Name.Reader.html#ImpDeclSpec"><span class="hs-identifier hs-type">ImpDeclSpec</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">is_mod :: ModuleName
</span><a href="GHC.Types.Name.Reader.html#is_mod"><span class="hs-identifier hs-var">is_mod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199401"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">is_as :: ModuleName
</span><a href="GHC.Types.Name.Reader.html#is_as"><span class="hs-identifier hs-var">is_as</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199401"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-791"></span><span>                         </span><span class="annot"><span class="annottext">is_qual :: Bool
</span><a href="GHC.Types.Name.Reader.html#is_qual"><span class="hs-identifier hs-var">is_qual</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span>
</span><span id="line-792"></span><span>                         </span><span class="annot"><span class="annottext">is_dloc :: SrcSpan
</span><a href="GHC.Types.Name.Reader.html#is_dloc"><span class="hs-identifier hs-var">is_dloc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcLoc -&gt; SrcSpan
</span><a href="GHC.Types.SrcLoc.html#srcLocSpan"><span class="hs-identifier hs-var">srcLocSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcLoc
</span><a href="GHC.Types.SrcLoc.html#interactiveSrcLoc"><span class="hs-identifier hs-var">interactiveSrcLoc</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-793"></span><span>
</span><span id="line-794"></span><span class="annot"><a href="GHC.Runtime.Eval.html#mkTopLevEnv"><span class="hs-identifier hs-type">mkTopLevEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HomePackageTable"><span class="hs-identifier hs-type">HomePackageTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span>
</span><span id="line-795"></span><span id="mkTopLevEnv"><span class="annot"><span class="annottext">mkTopLevEnv :: HomePackageTable -&gt; ModuleName -&gt; Either String GlobalRdrEnv
</span><a href="GHC.Runtime.Eval.html#mkTopLevEnv"><span class="hs-identifier hs-var hs-var">mkTopLevEnv</span></a></span></span><span> </span><span id="local-6989586621681199384"><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681199384"><span class="hs-identifier hs-var">hpt</span></a></span></span><span> </span><span id="local-6989586621681199383"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199383"><span class="hs-identifier hs-var">modl</span></a></span></span><span>
</span><span id="line-796"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681199384"><span class="hs-identifier hs-var">hpt</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681199383"><span class="hs-identifier hs-var">modl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-797"></span><span>      </span><span class="annot"><span class="annottext">Maybe HomeModInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Either String GlobalRdrEnv
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not a home module&quot;</span></span><span>
</span><span id="line-798"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199382"><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199382"><span class="hs-identifier hs-var">details</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-799"></span><span>         </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ModIface_ 'ModIfaceFinal -&gt; Maybe GlobalRdrEnv
forall (phase :: ModIfacePhase).
ModIface_ phase -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#mi_globals"><span class="hs-identifier hs-var hs-var">mi_globals</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface_ 'ModIfaceFinal
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199382"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-800"></span><span>                </span><span class="annot"><span class="annottext">Maybe GlobalRdrEnv
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Either String GlobalRdrEnv
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not interpreted&quot;</span></span><span>
</span><span id="line-801"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199380"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199380"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; Either String GlobalRdrEnv
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199380"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-802"></span><span>
</span><span id="line-803"></span><span class="hs-comment">-- | Get the interactive evaluation context, consisting of a pair of the</span><span>
</span><span id="line-804"></span><span class="hs-comment">-- set of modules from which we take the full top-level scope, and the set</span><span>
</span><span id="line-805"></span><span class="hs-comment">-- of modules from which we take just the exports respectively.</span><span>
</span><span id="line-806"></span><span id="local-6989586621681200547"><span class="annot"><a href="GHC.Runtime.Eval.html#getContext"><span class="hs-identifier hs-type">getContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200547"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200547"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#InteractiveImport"><span class="hs-identifier hs-type">InteractiveImport</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-807"></span><span id="getContext"><span class="annot"><span class="annottext">getContext :: forall (m :: * -&gt; *). GhcMonad m =&gt; m [InteractiveImport]
</span><a href="GHC.Runtime.Eval.html#getContext"><span class="hs-identifier hs-var hs-var">getContext</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [InteractiveImport]) -&gt; m [InteractiveImport]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m [InteractiveImport]) -&gt; m [InteractiveImport])
-&gt; (HscEnv -&gt; m [InteractiveImport]) -&gt; m [InteractiveImport]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_IC :: HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681199372"><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199372"><span class="hs-identifier hs-var">ic</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-808"></span><span>             </span><span class="annot"><span class="annottext">[InteractiveImport] -&gt; m [InteractiveImport]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InteractiveContext -&gt; [InteractiveImport]
</span><a href="GHC.Driver.Types.html#ic_imports"><span class="hs-identifier hs-var hs-var">ic_imports</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199372"><span class="hs-identifier hs-var">ic</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-809"></span><span>
</span><span id="line-810"></span><span class="hs-comment">-- | Returns @True@ if the specified module is interpreted, and hence has</span><span>
</span><span id="line-811"></span><span class="hs-comment">-- its full top-level scope available.</span><span>
</span><span id="line-812"></span><span id="local-6989586621681200545"><span class="annot"><a href="GHC.Runtime.Eval.html#moduleIsInterpreted"><span class="hs-identifier hs-type">moduleIsInterpreted</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200545"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200545"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-813"></span><span id="moduleIsInterpreted"><span class="annot"><span class="annottext">moduleIsInterpreted :: forall (m :: * -&gt; *). GhcMonad m =&gt; Module -&gt; m Bool
</span><a href="GHC.Runtime.Eval.html#moduleIsInterpreted"><span class="hs-identifier hs-var hs-var">moduleIsInterpreted</span></a></span></span><span> </span><span id="local-6989586621681199362"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199362"><span class="hs-identifier hs-var">modl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Bool) -&gt; m Bool
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Bool) -&gt; m Bool) -&gt; (HscEnv -&gt; m Bool) -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199361"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199361"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-814"></span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Module -&gt; Bool
</span><a href="GHC.Driver.Session.html#isHomeModule"><span class="hs-identifier hs-var">isHomeModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199361"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199362"><span class="hs-identifier hs-var">modl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-815"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-816"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199361"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199362"><span class="hs-identifier hs-var">modl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-817"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199359"><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199359"><span class="hs-identifier hs-var">details</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe GlobalRdrEnv -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModIface_ 'ModIfaceFinal -&gt; Maybe GlobalRdrEnv
forall (phase :: ModIfacePhase).
ModIface_ phase -&gt; Maybe GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#mi_globals"><span class="hs-identifier hs-var hs-var">mi_globals</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface_ 'ModIfaceFinal
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681199359"><span class="hs-identifier hs-var">details</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-818"></span><span>                </span><span id="local-6989586621681199357"><span class="annot"><span class="annottext">Maybe HomeModInfo
</span><a href="#local-6989586621681199357"><span class="hs-identifier hs-var">_not_a_home_module</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-819"></span><span>
</span><span id="line-820"></span><span class="hs-comment">-- | Looks up an identifier in the current interactive context (for :info)</span><span>
</span><span id="line-821"></span><span class="hs-comment">-- Filter the instances by the ones whose tycons (or clases resp)</span><span>
</span><span id="line-822"></span><span class="hs-comment">-- are in scope (qualified or otherwise).  Otherwise we list a whole lot too many!</span><span>
</span><span id="line-823"></span><span class="hs-comment">-- The exact choice of which ones to show, and which to hide, is a judgement call.</span><span>
</span><span id="line-824"></span><span class="hs-comment">--      (see #1581)</span><span>
</span><span id="line-825"></span><span id="local-6989586621681200543"><span class="annot"><a href="GHC.Runtime.Eval.html#getInfo"><span class="hs-identifier hs-type">getInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200543"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-826"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200543"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span class="hs-special">,</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInst"><span class="hs-identifier hs-type">FamInst</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-827"></span><span id="getInfo"><span class="annot"><span class="annottext">getInfo :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Bool
-&gt; Name
-&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
</span><a href="GHC.Runtime.Eval.html#getInfo"><span class="hs-identifier hs-var hs-var">getInfo</span></a></span></span><span> </span><span id="local-6989586621681199344"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199344"><span class="hs-identifier hs-var">allInfo</span></a></span></span><span> </span><span id="local-6989586621681199343"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199343"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-828"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv
 -&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)))
-&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv
  -&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)))
 -&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)))
-&gt; (HscEnv
    -&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)))
-&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199342"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199342"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-829"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681199341"><span class="annot"><span class="annottext">Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
</span><a href="#local-6989586621681199341"><span class="hs-identifier hs-var">mb_stuff</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
-&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
 -&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)))
-&gt; IO (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
-&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Name
-&gt; IO (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
</span><a href="GHC.Driver.Main.html#hscTcRnGetInfo"><span class="hs-identifier hs-var">hscTcRnGetInfo</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199342"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199343"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-830"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
</span><a href="#local-6989586621681199341"><span class="hs-identifier hs-var">mb_stuff</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-831"></span><span>         </span><span class="annot"><span class="annottext">Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
-&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-832"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681199339"><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681199339"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199338"><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681199338"><span class="hs-identifier hs-var">fixity</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199337"><span class="annot"><span class="annottext">[ClsInst]
</span><a href="#local-6989586621681199337"><span class="hs-identifier hs-var">cls_insts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199336"><span class="annot"><span class="annottext">[FamInst]
</span><a href="#local-6989586621681199336"><span class="hs-identifier hs-var">fam_insts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199335"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681199335"><span class="hs-identifier hs-var">docs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-833"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199334"><span class="annot"><span class="annottext">rdr_env :: GlobalRdrEnv
</span><a href="#local-6989586621681199334"><span class="hs-identifier hs-var hs-var">rdr_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#ic_rn_gbl_env"><span class="hs-identifier hs-var hs-var">ic_rn_gbl_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199342"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-834"></span><span>
</span><span id="line-835"></span><span>           </span><span class="hs-comment">-- Filter the instances based on whether the constituent names of their</span><span>
</span><span id="line-836"></span><span>           </span><span class="hs-comment">-- instance heads are all in scope.</span><span>
</span><span id="line-837"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199333"><span class="annot"><span class="annottext">cls_insts' :: [ClsInst]
</span><a href="#local-6989586621681199333"><span class="hs-identifier hs-var hs-var">cls_insts'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ClsInst -&gt; Bool) -&gt; [ClsInst] -&gt; [ClsInst]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; NameSet -&gt; Bool
</span><a href="#local-6989586621681199332"><span class="hs-identifier hs-var">plausible</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199334"><span class="hs-identifier hs-var">rdr_env</span></a></span><span> </span><span class="annot"><span class="annottext">(NameSet -&gt; Bool) -&gt; (ClsInst -&gt; NameSet) -&gt; ClsInst -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst -&gt; NameSet
</span><a href="GHC.Core.InstEnv.html#orphNamesOfClsInst"><span class="hs-identifier hs-var">orphNamesOfClsInst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ClsInst]
</span><a href="#local-6989586621681199337"><span class="hs-identifier hs-var">cls_insts</span></a></span><span>
</span><span id="line-838"></span><span>               </span><span id="local-6989586621681199330"><span class="annot"><span class="annottext">fam_insts' :: [FamInst]
</span><a href="#local-6989586621681199330"><span class="hs-identifier hs-var hs-var">fam_insts'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FamInst -&gt; Bool) -&gt; [FamInst] -&gt; [FamInst]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; NameSet -&gt; Bool
</span><a href="#local-6989586621681199332"><span class="hs-identifier hs-var">plausible</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199334"><span class="hs-identifier hs-var">rdr_env</span></a></span><span> </span><span class="annot"><span class="annottext">(NameSet -&gt; Bool) -&gt; (FamInst -&gt; NameSet) -&gt; FamInst -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FamInst -&gt; NameSet
</span><a href="GHC.Core.FVs.html#orphNamesOfFamInst"><span class="hs-identifier hs-var">orphNamesOfFamInst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FamInst]
</span><a href="#local-6989586621681199336"><span class="hs-identifier hs-var">fam_insts</span></a></span><span>
</span><span id="line-839"></span><span>           </span><span class="annot"><span class="annottext">Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
-&gt; m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
-&gt; Maybe (TyThing, Fixity, [ClsInst], [FamInst], MsgDoc)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681199339"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681199338"><span class="hs-identifier hs-var">fixity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ClsInst]
</span><a href="#local-6989586621681199333"><span class="hs-identifier hs-var">cls_insts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[FamInst]
</span><a href="#local-6989586621681199330"><span class="hs-identifier hs-var">fam_insts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681199335"><span class="hs-identifier hs-var">docs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-840"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-841"></span><span>    </span><span id="local-6989586621681199332"><span class="annot"><span class="annottext">plausible :: GlobalRdrEnv -&gt; NameSet -&gt; Bool
</span><a href="#local-6989586621681199332"><span class="hs-identifier hs-var hs-var">plausible</span></a></span></span><span> </span><span id="local-6989586621681199329"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199329"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span> </span><span id="local-6989586621681199328"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681199328"><span class="hs-identifier hs-var">names</span></a></span></span><span>
</span><span id="line-842"></span><span>          </span><span class="hs-comment">-- Dfun involving only names that are in ic_rn_glb_env</span><span>
</span><span id="line-843"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199344"><span class="hs-identifier hs-var">allInfo</span></a></span><span>
</span><span id="line-844"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; NameSet -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#nameSetAll"><span class="hs-identifier hs-var">nameSetAll</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="#local-6989586621681199325"><span class="hs-identifier hs-var">ok</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681199328"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-845"></span><span>        </span><span class="hs-keyword">where</span><span>   </span><span class="hs-comment">-- A name is ok if it's in the rdr_env,</span><span>
</span><span id="line-846"></span><span>                </span><span class="hs-comment">-- whether qualified or not</span><span>
</span><span id="line-847"></span><span>          </span><span id="local-6989586621681199325"><span class="annot"><span class="annottext">ok :: Name -&gt; Bool
</span><a href="#local-6989586621681199325"><span class="hs-identifier hs-var hs-var">ok</span></a></span></span><span> </span><span id="local-6989586621681199323"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199323"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199323"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199343"><span class="hs-identifier hs-var">name</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-848"></span><span>                       </span><span class="hs-comment">-- The one we looked for in the first place!</span><span>
</span><span id="line-849"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Builtin.Names.html#pretendNameIsInScope"><span class="hs-identifier hs-var">pretendNameIsInScope</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199323"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-850"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isBuiltInSyntax"><span class="hs-identifier hs-var">isBuiltInSyntax</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199323"><span class="hs-identifier hs-var">n</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-851"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Builtin.Types.html#isCTupleTyConName"><span class="hs-identifier hs-var">isCTupleTyConName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199323"><span class="hs-identifier hs-var">n</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-852"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isExternalName"><span class="hs-identifier hs-var">isExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199323"><span class="hs-identifier hs-var">n</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe GlobalRdrElt -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; Name -&gt; Maybe GlobalRdrElt
</span><a href="GHC.Types.Name.Reader.html#lookupGRE_Name"><span class="hs-identifier hs-var">lookupGRE_Name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199329"><span class="hs-identifier hs-var">rdr_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199323"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-853"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-854"></span><span>
</span><span id="line-855"></span><span class="hs-comment">-- | Returns all names in scope in the current interactive context</span><span>
</span><span id="line-856"></span><span id="local-6989586621681200537"><span class="annot"><a href="GHC.Runtime.Eval.html#getNamesInScope"><span class="hs-identifier hs-type">getNamesInScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200537"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200537"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-857"></span><span id="getNamesInScope"><span class="annot"><span class="annottext">getNamesInScope :: forall (m :: * -&gt; *). GhcMonad m =&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#getNamesInScope"><span class="hs-identifier hs-var hs-var">getNamesInScope</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [Name]) -&gt; m [Name]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m [Name]) -&gt; m [Name])
-&gt; (HscEnv -&gt; m [Name]) -&gt; m [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199312"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199312"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-858"></span><span>  </span><span class="annot"><span class="annottext">[Name] -&gt; m [Name]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; Name) -&gt; [GlobalRdrElt] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InteractiveContext -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#ic_rn_gbl_env"><span class="hs-identifier hs-var hs-var">ic_rn_gbl_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199312"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-859"></span><span>
</span><span id="line-860"></span><span class="hs-comment">-- | Returns all 'RdrName's in scope in the current interactive</span><span>
</span><span id="line-861"></span><span class="hs-comment">-- context, excluding any that are internally-generated.</span><span>
</span><span id="line-862"></span><span id="local-6989586621681200535"><span class="annot"><a href="GHC.Runtime.Eval.html#getRdrNamesInScope"><span class="hs-identifier hs-type">getRdrNamesInScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200535"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200535"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-863"></span><span id="getRdrNamesInScope"><span class="annot"><span class="annottext">getRdrNamesInScope :: forall (m :: * -&gt; *). GhcMonad m =&gt; m [RdrName]
</span><a href="GHC.Runtime.Eval.html#getRdrNamesInScope"><span class="hs-identifier hs-var hs-var">getRdrNamesInScope</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [RdrName]) -&gt; m [RdrName]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m [RdrName]) -&gt; m [RdrName])
-&gt; (HscEnv -&gt; m [RdrName]) -&gt; m [RdrName]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199302"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199302"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-864"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-865"></span><span>      </span><span id="local-6989586621681199301"><span class="annot"><span class="annottext">ic :: InteractiveContext
</span><a href="#local-6989586621681199301"><span class="hs-identifier hs-var hs-var">ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199302"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-866"></span><span>      </span><span id="local-6989586621681199300"><span class="annot"><span class="annottext">gbl_rdrenv :: GlobalRdrEnv
</span><a href="#local-6989586621681199300"><span class="hs-identifier hs-var hs-var">gbl_rdrenv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#ic_rn_gbl_env"><span class="hs-identifier hs-var hs-var">ic_rn_gbl_env</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681199301"><span class="hs-identifier hs-var">ic</span></a></span><span>
</span><span id="line-867"></span><span>      </span><span id="local-6989586621681199298"><span class="annot"><span class="annottext">gbl_names :: [RdrName]
</span><a href="#local-6989586621681199298"><span class="hs-identifier hs-var hs-var">gbl_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; [RdrName]) -&gt; [GlobalRdrElt] -&gt; [RdrName]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [RdrName]
</span><a href="GHC.Types.Name.Reader.html#greRdrNames"><span class="hs-identifier hs-var">greRdrNames</span></a></span><span> </span><span class="annot"><span class="annottext">([GlobalRdrElt] -&gt; [RdrName]) -&gt; [GlobalRdrElt] -&gt; [RdrName]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681199300"><span class="hs-identifier hs-var">gbl_rdrenv</span></a></span><span>
</span><span id="line-868"></span><span>  </span><span class="hs-comment">-- Exclude internally generated names; see e.g. #11328</span><span>
</span><span id="line-869"></span><span>  </span><span class="annot"><span class="annottext">[RdrName] -&gt; m [RdrName]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(RdrName -&gt; Bool) -&gt; [RdrName] -&gt; [RdrName]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (RdrName -&gt; Bool) -&gt; RdrName -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#isDerivedOccName"><span class="hs-identifier hs-var">isDerivedOccName</span></a></span><span> </span><span class="annot"><span class="annottext">(OccName -&gt; Bool) -&gt; (RdrName -&gt; OccName) -&gt; RdrName -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RdrName]
</span><a href="#local-6989586621681199298"><span class="hs-identifier hs-var">gbl_names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-870"></span><span>
</span><span id="line-871"></span><span>
</span><span id="line-872"></span><span class="hs-comment">-- | Parses a string as an identifier, and returns the list of 'Name's that</span><span>
</span><span id="line-873"></span><span class="hs-comment">-- the identifier can refer to in the current interactive context.</span><span>
</span><span id="line-874"></span><span id="local-6989586621681199294"><span class="annot"><a href="GHC.Runtime.Eval.html#parseName"><span class="hs-identifier hs-type">parseName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681199294"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681199294"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-875"></span><span id="parseName"><span class="annot"><span class="annottext">parseName :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#parseName"><span class="hs-identifier hs-var hs-var">parseName</span></a></span></span><span> </span><span id="local-6989586621681199287"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199287"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [Name]) -&gt; m [Name]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m [Name]) -&gt; m [Name])
-&gt; (HscEnv -&gt; m [Name]) -&gt; m [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199286"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199286"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO [Name] -&gt; m [Name]
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [Name] -&gt; m [Name]) -&gt; IO [Name] -&gt; m [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-876"></span><span>   </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681199285"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681199285"><span class="hs-identifier hs-var">lrdr_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; String -&gt; IO (Located RdrName)
</span><a href="GHC.Driver.Main.html#hscParseIdentifier"><span class="hs-identifier hs-var">hscParseIdentifier</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199286"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199287"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-877"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Located RdrName -&gt; IO [Name]
</span><a href="GHC.Driver.Main.html#hscTcRnLookupRdrName"><span class="hs-identifier hs-var">hscTcRnLookupRdrName</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199286"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681199285"><span class="hs-identifier hs-var">lrdr_name</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-878"></span><span>
</span><span id="line-879"></span><span class="hs-comment">-- | Returns @True@ if passed string is a statement.</span><span>
</span><span id="line-880"></span><span class="annot"><a href="GHC.Runtime.Eval.html#isStmt"><span class="hs-identifier hs-type">isStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#ParserFlags"><span class="hs-identifier hs-type">ParserFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-881"></span><span id="isStmt"><span class="annot"><span class="annottext">isStmt :: ParserFlags -&gt; String -&gt; Bool
</span><a href="GHC.Runtime.Eval.html#isStmt"><span class="hs-identifier hs-var hs-var">isStmt</span></a></span></span><span> </span><span id="local-6989586621681199282"><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199282"><span class="hs-identifier hs-var">pflags</span></a></span></span><span> </span><span id="local-6989586621681199281"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199281"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-882"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P (Maybe (GhciLStmt GhcPs))
-&gt; ParserFlags -&gt; String -&gt; ParseResult (Maybe (GhciLStmt GhcPs))
forall thing. P thing -&gt; ParserFlags -&gt; String -&gt; ParseResult thing
</span><a href="GHC.Runtime.Eval.html#parseThing"><span class="hs-identifier hs-var">parseThing</span></a></span><span> </span><span class="annot"><span class="annottext">P (Maybe (GhciLStmt GhcPs))
</span><a href="GHC.Parser.html#parseStmt"><span class="hs-identifier hs-var">Parser.parseStmt</span></a></span><span> </span><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199282"><span class="hs-identifier hs-var">pflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199281"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-883"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">Lexer.POk</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe (GhciLStmt GhcPs)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-884"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">Lexer.PFailed</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-885"></span><span>
</span><span id="line-886"></span><span class="hs-comment">-- | Returns @True@ if passed string has an import declaration.</span><span>
</span><span id="line-887"></span><span class="annot"><a href="GHC.Runtime.Eval.html#hasImport"><span class="hs-identifier hs-type">hasImport</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#ParserFlags"><span class="hs-identifier hs-type">ParserFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-888"></span><span id="hasImport"><span class="annot"><span class="annottext">hasImport :: ParserFlags -&gt; String -&gt; Bool
</span><a href="GHC.Runtime.Eval.html#hasImport"><span class="hs-identifier hs-var hs-var">hasImport</span></a></span></span><span> </span><span id="local-6989586621681199277"><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199277"><span class="hs-identifier hs-var">pflags</span></a></span></span><span> </span><span id="local-6989586621681199276"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199276"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-889"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P (Located HsModule)
-&gt; ParserFlags -&gt; String -&gt; ParseResult (Located HsModule)
forall thing. P thing -&gt; ParserFlags -&gt; String -&gt; ParseResult thing
</span><a href="GHC.Runtime.Eval.html#parseThing"><span class="hs-identifier hs-var">parseThing</span></a></span><span> </span><span class="annot"><span class="annottext">P (Located HsModule)
</span><a href="GHC.Parser.html#parseModule"><span class="hs-identifier hs-var">Parser.parseModule</span></a></span><span> </span><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199277"><span class="hs-identifier hs-var">pflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199276"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-890"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">Lexer.POk</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681199275"><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681199275"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Located HsModule -&gt; Bool
forall {l}. GenLocated l HsModule -&gt; Bool
</span><a href="#local-6989586621681199274"><span class="hs-identifier hs-var">hasImports</span></a></span><span> </span><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681199275"><span class="hs-identifier hs-var">thing</span></a></span><span>
</span><span id="line-891"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">Lexer.PFailed</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-892"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-893"></span><span>    </span><span id="local-6989586621681199274"><span class="annot"><span class="annottext">hasImports :: GenLocated l HsModule -&gt; Bool
</span><a href="#local-6989586621681199274"><span class="hs-identifier hs-var hs-var">hasImports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool)
-&gt; (GenLocated l HsModule -&gt; Bool) -&gt; GenLocated l HsModule -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[LImportDecl GhcPs] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">([LImportDecl GhcPs] -&gt; Bool)
-&gt; (GenLocated l HsModule -&gt; [LImportDecl GhcPs])
-&gt; GenLocated l HsModule
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HsModule -&gt; [LImportDecl GhcPs]
</span><a href="GHC.Hs.html#hsmodImports"><span class="hs-identifier hs-var hs-var">hsmodImports</span></a></span><span> </span><span class="annot"><span class="annottext">(HsModule -&gt; [LImportDecl GhcPs])
-&gt; (GenLocated l HsModule -&gt; HsModule)
-&gt; GenLocated l HsModule
-&gt; [LImportDecl GhcPs]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated l HsModule -&gt; HsModule
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span>
</span><span id="line-894"></span><span>
</span><span id="line-895"></span><span class="hs-comment">-- | Returns @True@ if passed string is an import declaration.</span><span>
</span><span id="line-896"></span><span class="annot"><a href="GHC.Runtime.Eval.html#isImport"><span class="hs-identifier hs-type">isImport</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#ParserFlags"><span class="hs-identifier hs-type">ParserFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-897"></span><span id="isImport"><span class="annot"><span class="annottext">isImport :: ParserFlags -&gt; String -&gt; Bool
</span><a href="GHC.Runtime.Eval.html#isImport"><span class="hs-identifier hs-var hs-var">isImport</span></a></span></span><span> </span><span id="local-6989586621681199270"><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199270"><span class="hs-identifier hs-var">pflags</span></a></span></span><span> </span><span id="local-6989586621681199269"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199269"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-898"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P (LImportDecl GhcPs)
-&gt; ParserFlags -&gt; String -&gt; ParseResult (LImportDecl GhcPs)
forall thing. P thing -&gt; ParserFlags -&gt; String -&gt; ParseResult thing
</span><a href="GHC.Runtime.Eval.html#parseThing"><span class="hs-identifier hs-var">parseThing</span></a></span><span> </span><span class="annot"><span class="annottext">P (LImportDecl GhcPs)
</span><a href="GHC.Parser.html#parseImport"><span class="hs-identifier hs-var">Parser.parseImport</span></a></span><span> </span><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199270"><span class="hs-identifier hs-var">pflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199269"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-899"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">Lexer.POk</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LImportDecl GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-900"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">Lexer.PFailed</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-901"></span><span>
</span><span id="line-902"></span><span class="hs-comment">-- | Returns @True@ if passed string is a declaration but __/not a splice/__.</span><span>
</span><span id="line-903"></span><span class="annot"><a href="GHC.Runtime.Eval.html#isDecl"><span class="hs-identifier hs-type">isDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#ParserFlags"><span class="hs-identifier hs-type">ParserFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-904"></span><span id="isDecl"><span class="annot"><span class="annottext">isDecl :: ParserFlags -&gt; String -&gt; Bool
</span><a href="GHC.Runtime.Eval.html#isDecl"><span class="hs-identifier hs-var hs-var">isDecl</span></a></span></span><span> </span><span id="local-6989586621681199268"><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199268"><span class="hs-identifier hs-var">pflags</span></a></span></span><span> </span><span id="local-6989586621681199267"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199267"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-905"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P (LHsDecl GhcPs)
-&gt; ParserFlags -&gt; String -&gt; ParseResult (LHsDecl GhcPs)
forall thing. P thing -&gt; ParserFlags -&gt; String -&gt; ParseResult thing
</span><a href="GHC.Runtime.Eval.html#parseThing"><span class="hs-identifier hs-var">parseThing</span></a></span><span> </span><span class="annot"><span class="annottext">P (LHsDecl GhcPs)
</span><a href="GHC.Parser.html#parseDeclaration"><span class="hs-identifier hs-var">Parser.parseDeclaration</span></a></span><span> </span><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199268"><span class="hs-identifier hs-var">pflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199267"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-906"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">Lexer.POk</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681199266"><span class="annot"><span class="annottext">LHsDecl GhcPs
</span><a href="#local-6989586621681199266"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-907"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LHsDecl GhcPs -&gt; HsDecl GhcPs
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsDecl GhcPs
</span><a href="#local-6989586621681199266"><span class="hs-identifier hs-var">thing</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-908"></span><span>        </span><span class="annot"><a href="GHC.Hs.Decls.html#SpliceD"><span class="hs-identifier hs-type">SpliceD</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliceD GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SpliceDecl GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-909"></span><span>        </span><span class="annot"><span class="annottext">HsDecl GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-910"></span><span>    </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">Lexer.PFailed</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-911"></span><span>
</span><span id="line-912"></span><span id="local-6989586621681200525"><span class="annot"><a href="GHC.Runtime.Eval.html#parseThing"><span class="hs-identifier hs-type">parseThing</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#P"><span class="hs-identifier hs-type">Lexer.P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200525"><span class="hs-identifier hs-type">thing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#ParserFlags"><span class="hs-identifier hs-type">ParserFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html#ParseResult"><span class="hs-identifier hs-type">Lexer.ParseResult</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200525"><span class="hs-identifier hs-type">thing</span></a></span></span><span>
</span><span id="line-913"></span><span id="parseThing"><span class="annot"><span class="annottext">parseThing :: forall thing. P thing -&gt; ParserFlags -&gt; String -&gt; ParseResult thing
</span><a href="GHC.Runtime.Eval.html#parseThing"><span class="hs-identifier hs-var hs-var">parseThing</span></a></span></span><span> </span><span id="local-6989586621681199264"><span class="annot"><span class="annottext">P thing
</span><a href="#local-6989586621681199264"><span class="hs-identifier hs-var">parser</span></a></span></span><span> </span><span id="local-6989586621681199263"><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199263"><span class="hs-identifier hs-var">pflags</span></a></span></span><span> </span><span id="local-6989586621681199262"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199262"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-914"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199261"><span class="annot"><span class="annottext">buf :: StringBuffer
</span><a href="#local-6989586621681199261"><span class="hs-identifier hs-var hs-var">buf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; StringBuffer
</span><a href="GHC.Data.StringBuffer.html#stringToStringBuffer"><span class="hs-identifier hs-var">stringToStringBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199262"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-915"></span><span>      </span><span id="local-6989586621681199260"><span class="annot"><span class="annottext">loc :: RealSrcLoc
</span><a href="#local-6989586621681199260"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier hs-var">mkRealSrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;interactive&gt;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-916"></span><span>
</span><span id="line-917"></span><span>  </span><span class="annot"><span class="annottext">P thing -&gt; PState -&gt; ParseResult thing
forall a. P a -&gt; PState -&gt; ParseResult a
</span><a href="GHC.Parser.Lexer.html#unP"><span class="hs-identifier hs-var hs-var">Lexer.unP</span></a></span><span> </span><span class="annot"><span class="annottext">P thing
</span><a href="#local-6989586621681199264"><span class="hs-identifier hs-var">parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParserFlags -&gt; StringBuffer -&gt; RealSrcLoc -&gt; PState
</span><a href="GHC.Parser.Lexer.html#mkPStatePure"><span class="hs-identifier hs-var">Lexer.mkPStatePure</span></a></span><span> </span><span class="annot"><span class="annottext">ParserFlags
</span><a href="#local-6989586621681199263"><span class="hs-identifier hs-var">pflags</span></a></span><span> </span><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621681199261"><span class="hs-identifier hs-var">buf</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681199260"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-918"></span><span>
</span><span id="line-919"></span><span id="local-6989586621681200511"><span class="annot"><a href="GHC.Runtime.Eval.html#getDocs"><span class="hs-identifier hs-type">getDocs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200511"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-920"></span><span>        </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-921"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200511"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#GetDocsFailure"><span class="hs-identifier hs-type">GetDocsFailure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Doc.html#HsDocString"><span class="hs-identifier hs-type">HsDocString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><a href="GHC.Hs.Doc.html#HsDocString"><span class="hs-identifier hs-type">HsDocString</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-922"></span><span>           </span><span class="hs-comment">-- TODO: What about docs for constructors etc.?</span><span>
</span><span id="line-923"></span><span id="getDocs"><span class="annot"><span class="annottext">getDocs :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Name
-&gt; m (Either
        GetDocsFailure (Maybe HsDocString, Map Int HsDocString))
</span><a href="GHC.Runtime.Eval.html#getDocs"><span class="hs-identifier hs-var hs-var">getDocs</span></a></span></span><span> </span><span id="local-6989586621681199241"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199241"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-924"></span><span>  </span><span class="annot"><span class="annottext">(HscEnv
 -&gt; m (Either
         GetDocsFailure (Maybe HsDocString, Map Int HsDocString)))
-&gt; m (Either
        GetDocsFailure (Maybe HsDocString, Map Int HsDocString))
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv
  -&gt; m (Either
          GetDocsFailure (Maybe HsDocString, Map Int HsDocString)))
 -&gt; m (Either
         GetDocsFailure (Maybe HsDocString, Map Int HsDocString)))
-&gt; (HscEnv
    -&gt; m (Either
            GetDocsFailure (Maybe HsDocString, Map Int HsDocString)))
-&gt; m (Either
        GetDocsFailure (Maybe HsDocString, Map Int HsDocString))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199240"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199240"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-925"></span><span>     </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe Module
</span><a href="GHC.Types.Name.html#nameModule_maybe"><span class="hs-identifier hs-var">nameModule_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199241"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-926"></span><span>       </span><span class="annot"><span class="annottext">Maybe Module
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
-&gt; m (Either
        GetDocsFailure (Maybe HsDocString, Map Int HsDocString))
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GetDocsFailure
-&gt; Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; GetDocsFailure
</span><a href="GHC.Runtime.Eval.html#NameHasNoModule"><span class="hs-identifier hs-var">NameHasNoModule</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199241"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-927"></span><span>       </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681199237"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199237"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-928"></span><span>         </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Module -&gt; Bool
</span><a href="GHC.Unit.Types.html#isInteractiveModule"><span class="hs-identifier hs-var">isInteractiveModule</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199237"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-929"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
-&gt; m (Either
        GetDocsFailure (Maybe HsDocString, Map Int HsDocString))
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GetDocsFailure
-&gt; Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">GetDocsFailure
</span><a href="GHC.Runtime.Eval.html#InteractiveName"><span class="hs-identifier hs-var">InteractiveName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-930"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-931"></span><span>             </span><span class="annot"><a href="GHC.Driver.Types.html#ModIface"><span class="hs-identifier hs-type">ModIface</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mi_doc_hdr :: forall (phase :: ModIfacePhase).
ModIface_ phase -&gt; Maybe HsDocString
</span><a href="GHC.Driver.Types.html#mi_doc_hdr"><span class="hs-identifier hs-var">mi_doc_hdr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199232"><span class="annot"><span class="annottext">Maybe HsDocString
</span><a href="#local-6989586621681199232"><span class="hs-identifier hs-var">mb_doc_hdr</span></a></span></span><span>
</span><span id="line-932"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mi_decl_docs :: forall (phase :: ModIfacePhase). ModIface_ phase -&gt; DeclDocMap
</span><a href="GHC.Driver.Types.html#mi_decl_docs"><span class="hs-identifier hs-var">mi_decl_docs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Doc.html#DeclDocMap"><span class="hs-identifier hs-type">DeclDocMap</span></a></span><span> </span><span id="local-6989586621681199229"><span class="annot"><span class="annottext">Map Name HsDocString
</span><a href="#local-6989586621681199229"><span class="hs-identifier hs-var">dmap</span></a></span></span><span>
</span><span id="line-933"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mi_arg_docs :: forall (phase :: ModIfacePhase). ModIface_ phase -&gt; ArgDocMap
</span><a href="GHC.Driver.Types.html#mi_arg_docs"><span class="hs-identifier hs-var">mi_arg_docs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Doc.html#ArgDocMap"><span class="hs-identifier hs-type">ArgDocMap</span></a></span><span> </span><span id="local-6989586621681199226"><span class="annot"><span class="annottext">Map Name (Map Int HsDocString)
</span><a href="#local-6989586621681199226"><span class="hs-identifier hs-var">amap</span></a></span></span><span>
</span><span id="line-934"></span><span>                      </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (ModIface_ 'ModIfaceFinal) -&gt; m (ModIface_ 'ModIfaceFinal)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (ModIface_ 'ModIfaceFinal) -&gt; m (ModIface_ 'ModIfaceFinal))
-&gt; IO (ModIface_ 'ModIfaceFinal) -&gt; m (ModIface_ 'ModIfaceFinal)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Module -&gt; IO (ModIface_ 'ModIfaceFinal)
</span><a href="GHC.Driver.Main.html#hscGetModuleInterface"><span class="hs-identifier hs-var">hscGetModuleInterface</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199240"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199237"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-935"></span><span>             </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Maybe HsDocString -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isNothing"><span class="hs-identifier hs-var">isNothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe HsDocString
</span><a href="#local-6989586621681199232"><span class="hs-identifier hs-var">mb_doc_hdr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Map Name HsDocString -&gt; Bool
forall k a. Map k a -&gt; Bool
</span><a href="../../containers/src/Data.Map.Internal.html#null"><span class="hs-identifier hs-var">Map.null</span></a></span><span> </span><span class="annot"><span class="annottext">Map Name HsDocString
</span><a href="#local-6989586621681199229"><span class="hs-identifier hs-var">dmap</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Map Name (Map Int HsDocString) -&gt; Bool
forall k a. Map k a -&gt; Bool
</span><a href="../../containers/src/Data.Map.Internal.html#null"><span class="hs-identifier hs-var">Map.null</span></a></span><span> </span><span class="annot"><span class="annottext">Map Name (Map Int HsDocString)
</span><a href="#local-6989586621681199226"><span class="hs-identifier hs-var">amap</span></a></span><span>
</span><span id="line-936"></span><span>               </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
-&gt; m (Either
        GetDocsFailure (Maybe HsDocString, Map Int HsDocString))
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GetDocsFailure
-&gt; Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Bool -&gt; GetDocsFailure
</span><a href="GHC.Runtime.Eval.html#NoDocsInIface"><span class="hs-identifier hs-var">NoDocsInIface</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199237"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199221"><span class="hs-identifier hs-var">compiled</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-937"></span><span>               </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
-&gt; m (Either
        GetDocsFailure (Maybe HsDocString, Map Int HsDocString))
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Maybe HsDocString, Map Int HsDocString)
-&gt; Either GetDocsFailure (Maybe HsDocString, Map Int HsDocString)
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Map Name HsDocString -&gt; Maybe HsDocString
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199241"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Map Name HsDocString
</span><a href="#local-6989586621681199229"><span class="hs-identifier hs-var">dmap</span></a></span><span>
</span><span id="line-938"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Map Int HsDocString
-&gt; Name -&gt; Map Name (Map Int HsDocString) -&gt; Map Int HsDocString
forall k a. Ord k =&gt; a -&gt; k -&gt; Map k a -&gt; a
</span><a href="../../containers/src/Data.Map.Internal.html#findWithDefault"><span class="hs-identifier hs-var">Map.findWithDefault</span></a></span><span> </span><span class="annot"><span class="annottext">Map Int HsDocString
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199241"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Map Name (Map Int HsDocString)
</span><a href="#local-6989586621681199226"><span class="hs-identifier hs-var">amap</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-939"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-940"></span><span>    </span><span id="local-6989586621681199221"><span class="annot"><span class="annottext">compiled :: Bool
</span><a href="#local-6989586621681199221"><span class="hs-identifier hs-var hs-var">compiled</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-941"></span><span>      </span><span class="hs-comment">-- TODO: Find a more direct indicator.</span><span>
</span><span id="line-942"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SrcLoc
</span><a href="GHC.Types.Name.html#nameSrcLoc"><span class="hs-identifier hs-var">nameSrcLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199241"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-943"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcLoc"><span class="hs-identifier hs-type">RealSrcLoc</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-944"></span><span>        </span><span class="annot"><a href="GHC.Types.SrcLoc.html#UnhelpfulLoc"><span class="hs-identifier hs-type">UnhelpfulLoc</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-945"></span><span>
</span><span id="line-946"></span><span class="hs-comment">-- | Failure modes for 'getDocs'.</span><span>
</span><span id="line-947"></span><span>
</span><span id="line-948"></span><span class="hs-comment">-- TODO: Find a way to differentiate between modules loaded without '-haddock'</span><span>
</span><span id="line-949"></span><span class="hs-comment">-- and modules that contain no docs.</span><span>
</span><span id="line-950"></span><span class="hs-keyword">data</span><span> </span><span id="GetDocsFailure"><span class="annot"><a href="GHC.Runtime.Eval.html#GetDocsFailure"><span class="hs-identifier hs-var">GetDocsFailure</span></a></span></span><span>
</span><span id="line-951"></span><span>
</span><span id="line-952"></span><span>    </span><span class="hs-comment">-- | 'nameModule_maybe' returned 'Nothing'.</span><span>
</span><span id="line-953"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="NameHasNoModule"><span class="annot"><a href="GHC.Runtime.Eval.html#NameHasNoModule"><span class="hs-identifier hs-var">NameHasNoModule</span></a></span></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-954"></span><span>
</span><span id="line-955"></span><span>    </span><span class="hs-comment">-- | This is probably because the module was loaded without @-haddock@,</span><span>
</span><span id="line-956"></span><span>    </span><span class="hs-comment">-- but it's also possible that the entire module contains no documentation.</span><span>
</span><span id="line-957"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NoDocsInIface"><span class="annot"><a href="GHC.Runtime.Eval.html#NoDocsInIface"><span class="hs-identifier hs-var">NoDocsInIface</span></a></span></span><span>
</span><span id="line-958"></span><span>      </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-959"></span><span>      </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-comment">-- ^ 'True': The module was compiled.</span><span>
</span><span id="line-960"></span><span>           </span><span class="hs-comment">-- 'False': The module was :loaded.</span><span>
</span><span id="line-961"></span><span>
</span><span id="line-962"></span><span>    </span><span class="hs-comment">-- | The 'Name' was defined interactively.</span><span>
</span><span id="line-963"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="InteractiveName"><span class="annot"><a href="GHC.Runtime.Eval.html#InteractiveName"><span class="hs-identifier hs-var">InteractiveName</span></a></span></span><span>
</span><span id="line-964"></span><span>
</span><span id="line-965"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681199212"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Eval.html#GetDocsFailure"><span class="hs-identifier hs-type">GetDocsFailure</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-966"></span><span>  </span><span id="local-6989586621681199206"><span class="annot"><span class="annottext">ppr :: GetDocsFailure -&gt; MsgDoc
</span><a href="#local-6989586621681199206"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Eval.html#NameHasNoModule"><span class="hs-identifier hs-type">NameHasNoModule</span></a></span><span> </span><span id="local-6989586621681199205"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199205"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-967"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199205"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;has no module where we could look for docs.&quot;</span></span><span>
</span><span id="line-968"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Eval.html#NoDocsInIface"><span class="hs-identifier hs-type">NoDocsInIface</span></a></span><span> </span><span id="local-6989586621681199203"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199203"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681199202"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199202"><span class="hs-identifier hs-var">compiled</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-969"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Can't find any documentation for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681199203"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span>
</span><span id="line-970"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;This is probably because the module was&quot;</span></span><span>
</span><span id="line-971"></span><span>        </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199202"><span class="hs-identifier hs-var">compiled</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;compiled&quot;</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;loaded&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-972"></span><span>        </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;without '-haddock',&quot;</span></span><span>
</span><span id="line-973"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;but it's also possible that the module contains no documentation.&quot;</span></span><span>
</span><span id="line-974"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-975"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199202"><span class="hs-identifier hs-var">compiled</span></a></span><span>
</span><span id="line-976"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Try re-compiling with '-haddock'.&quot;</span></span><span>
</span><span id="line-977"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Try running ':set -haddock' and :load the file again.&quot;</span></span><span>
</span><span id="line-978"></span><span>        </span><span class="hs-comment">-- TODO: Figure out why :reload doesn't load the docs and maybe fix it.</span><span>
</span><span id="line-979"></span><span>    </span><span class="hs-special">]</span><span>
</span><span id="line-980"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">GetDocsFailure
</span><a href="GHC.Runtime.Eval.html#InteractiveName"><span class="hs-identifier hs-var">InteractiveName</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-981"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Docs are unavailable for interactive declarations.&quot;</span></span><span>
</span><span id="line-982"></span><span>
</span><span id="line-983"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-984"></span><span class="hs-comment">-- Getting the type of an expression</span><span>
</span><span id="line-985"></span><span>
</span><span id="line-986"></span><span class="hs-comment">-- | Get the type of an expression</span><span>
</span><span id="line-987"></span><span class="hs-comment">-- Returns the type as described by 'TcRnExprMode'</span><span>
</span><span id="line-988"></span><span id="local-6989586621681200494"><span class="annot"><a href="GHC.Runtime.Eval.html#exprType"><span class="hs-identifier hs-type">exprType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200494"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html#TcRnExprMode"><span class="hs-identifier hs-type">TcRnExprMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200494"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span></span><span>
</span><span id="line-989"></span><span id="exprType"><span class="annot"><span class="annottext">exprType :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
TcRnExprMode -&gt; String -&gt; m Kind
</span><a href="GHC.Runtime.Eval.html#exprType"><span class="hs-identifier hs-var hs-var">exprType</span></a></span></span><span> </span><span id="local-6989586621681199188"><span class="annot"><span class="annottext">TcRnExprMode
</span><a href="#local-6989586621681199188"><span class="hs-identifier hs-var">mode</span></a></span></span><span> </span><span id="local-6989586621681199187"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199187"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Kind) -&gt; m Kind
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Kind) -&gt; m Kind) -&gt; (HscEnv -&gt; m Kind) -&gt; m Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199186"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199186"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-990"></span><span>   </span><span id="local-6989586621681199185"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199185"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Kind -&gt; m Kind
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Kind -&gt; m Kind) -&gt; IO Kind -&gt; m Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TcRnExprMode -&gt; String -&gt; IO Kind
</span><a href="GHC.Driver.Main.html#hscTcExpr"><span class="hs-identifier hs-var">hscTcExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199186"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">TcRnExprMode
</span><a href="#local-6989586621681199188"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199187"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-991"></span><span>   </span><span class="annot"><span class="annottext">Kind -&gt; m Kind
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; m Kind) -&gt; Kind -&gt; m Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="GHC.Types.Var.Env.html#emptyTidyEnv"><span class="hs-identifier hs-var">emptyTidyEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199185"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-992"></span><span>
</span><span id="line-993"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-994"></span><span class="hs-comment">-- Getting the kind of a type</span><span>
</span><span id="line-995"></span><span>
</span><span id="line-996"></span><span class="hs-comment">-- | Get the kind of a  type</span><span>
</span><span id="line-997"></span><span id="local-6989586621681200491"><span class="annot"><a href="GHC.Runtime.Eval.html#typeKind"><span class="hs-identifier hs-type">typeKind</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200491"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200491"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-998"></span><span id="typeKind"><span class="annot"><span class="annottext">typeKind :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
Bool -&gt; String -&gt; m (Kind, Kind)
</span><a href="GHC.Runtime.Eval.html#typeKind"><span class="hs-identifier hs-var hs-var">typeKind</span></a></span></span><span> </span><span id="local-6989586621681199177"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199177"><span class="hs-identifier hs-var">normalise</span></a></span></span><span> </span><span id="local-6989586621681199176"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199176"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (Kind, Kind)) -&gt; m (Kind, Kind)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (Kind, Kind)) -&gt; m (Kind, Kind))
-&gt; (HscEnv -&gt; m (Kind, Kind)) -&gt; m (Kind, Kind)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199175"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199175"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-999"></span><span>   </span><span class="annot"><span class="annottext">IO (Kind, Kind) -&gt; m (Kind, Kind)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Kind, Kind) -&gt; m (Kind, Kind))
-&gt; IO (Kind, Kind) -&gt; m (Kind, Kind)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Bool -&gt; String -&gt; IO (Kind, Kind)
</span><a href="GHC.Driver.Main.html#hscKcType"><span class="hs-identifier hs-var">hscKcType</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199175"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681199177"><span class="hs-identifier hs-var">normalise</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199176"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-1000"></span><span>
</span><span id="line-1001"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-1002"></span><span class="hs-comment">-- Getting the class instances for a type</span><span>
</span><span id="line-1003"></span><span>
</span><span id="line-1004"></span><span class="hs-comment">{-
  Note [Querying instances for a type]

  Here is the implementation of GHC proposal 41.
  (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0041-ghci-instances.rst)

  The objective is to take a query string representing a (partial) type, and
  report all the class single-parameter class instances available to that type.
  Extending this feature to multi-parameter typeclasses is left as future work.

  The general outline of how we solve this is:

  1. Parse the type, leaving skolems in the place of type-holes.
  2. For every class, get a list of all instances that match with the query type.
  3. For every matching instance, ask GHC for the context the instance dictionary needs.
  4. Format and present the results, substituting our query into the instance
     and simplifying the context.

  For example, given the query &quot;Maybe Int&quot;, we want to return:

  instance Show (Maybe Int)
  instance Read (Maybe Int)
  instance Eq   (Maybe Int)
  ....

  [Holes in queries]

  Often times we want to know what instances are available for a polymorphic type,
  like `Maybe a`, and we'd like to return instances such as:

  instance Show a =&gt; Show (Maybe a)
  ....

  These queries are expressed using type holes, so instead of `Maybe a` the user writes
  `Maybe _`, we parse the type and during zonking, we skolemise it, replacing the holes
  with (un-named) type variables.

  When zonking the type holes we have two real choices: replace them with Any or replace
  them with skolem typevars. Using skolem type variables ensures that the output is more
  intuitive to end users, and there is no difference in the results between Any and skolems.

-}</span><span>
</span><span id="line-1046"></span><span>
</span><span id="line-1047"></span><span class="hs-comment">-- Find all instances that match a provided type</span><span>
</span><span id="line-1048"></span><span id="local-6989586621681200489"><span class="annot"><a href="GHC.Runtime.Eval.html#getInstancesForType"><span class="hs-identifier hs-type">getInstancesForType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200489"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200489"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1049"></span><span id="getInstancesForType"><span class="annot"><span class="annottext">getInstancesForType :: forall (m :: * -&gt; *). GhcMonad m =&gt; Kind -&gt; m [ClsInst]
</span><a href="GHC.Runtime.Eval.html#getInstancesForType"><span class="hs-identifier hs-var hs-var">getInstancesForType</span></a></span></span><span> </span><span id="local-6989586621681199162"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199162"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m [ClsInst]) -&gt; m [ClsInst]
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m [ClsInst]) -&gt; m [ClsInst])
-&gt; (HscEnv -&gt; m [ClsInst]) -&gt; m [ClsInst]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199161"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199161"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1050"></span><span>  </span><span class="annot"><span class="annottext">IO [ClsInst] -&gt; m [ClsInst]
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [ClsInst] -&gt; m [ClsInst]) -&gt; IO [ClsInst] -&gt; m [ClsInst]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Hsc [ClsInst] -&gt; IO [ClsInst]
forall a. HscEnv -&gt; Hsc a -&gt; IO a
</span><a href="GHC.Driver.Types.html#runInteractiveHsc"><span class="hs-identifier hs-var">runInteractiveHsc</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199161"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(Hsc [ClsInst] -&gt; IO [ClsInst]) -&gt; Hsc [ClsInst] -&gt; IO [ClsInst]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1051"></span><span>    </span><span class="annot"><span class="annottext">IO (Messages, Maybe [ClsInst]) -&gt; Hsc [ClsInst]
forall a. IO (Messages, Maybe a) -&gt; Hsc a
</span><a href="GHC.Driver.Main.html#ioMsgMaybe"><span class="hs-identifier hs-var">ioMsgMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Messages, Maybe [ClsInst]) -&gt; Hsc [ClsInst])
-&gt; IO (Messages, Maybe [ClsInst]) -&gt; Hsc [ClsInst]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TcRn [ClsInst] -&gt; IO (Messages, Maybe [ClsInst])
forall a. HscEnv -&gt; TcRn a -&gt; IO (Messages, Maybe a)
</span><a href="GHC.Tc.Module.html#runTcInteractive"><span class="hs-identifier hs-var">runTcInteractive</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199161"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn [ClsInst] -&gt; IO (Messages, Maybe [ClsInst]))
-&gt; TcRn [ClsInst] -&gt; IO (Messages, Maybe [ClsInst])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1052"></span><span>      </span><span class="hs-comment">-- Bring class and instances from unqualified modules into scope, this fixes #16793.</span><span>
</span><span id="line-1053"></span><span>      </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext -&gt; TcM ()
</span><a href="GHC.Tc.Module.html#loadUnqualIfaces"><span class="hs-identifier hs-var">loadUnqualIfaces</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199161"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199161"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1054"></span><span>      </span><span id="local-6989586621681199159"><span class="annot"><span class="annottext">[(ClsInst, [Maybe Kind])]
</span><a href="#local-6989586621681199159"><span class="hs-identifier hs-var">matches</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; TcM [(ClsInst, [Maybe Kind])]
</span><a href="GHC.Runtime.Eval.html#findMatchingInstances"><span class="hs-identifier hs-var">findMatchingInstances</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199162"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1055"></span><span>
</span><span id="line-1056"></span><span>      </span><span class="annot"><span class="annottext">([Maybe ClsInst] -&gt; [ClsInst])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Maybe ClsInst] -&gt; TcRn [ClsInst]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe ClsInst] -&gt; [ClsInst]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) [Maybe ClsInst] -&gt; TcRn [ClsInst])
-&gt; (((ClsInst, [Maybe Kind])
     -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Maybe ClsInst])
-&gt; ((ClsInst, [Maybe Kind])
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
-&gt; TcRn [ClsInst]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[(ClsInst, [Maybe Kind])]
-&gt; ((ClsInst, [Maybe Kind])
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Maybe ClsInst]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="annot"><span class="annottext">[(ClsInst, [Maybe Kind])]
</span><a href="#local-6989586621681199159"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="annot"><span class="annottext">(((ClsInst, [Maybe Kind])
  -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
 -&gt; TcRn [ClsInst])
-&gt; ((ClsInst, [Maybe Kind])
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
-&gt; TcRn [ClsInst]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(ClsInst
 -&gt; [Maybe Kind] -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
-&gt; (ClsInst, [Maybe Kind])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst)
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
-&gt; [Maybe Kind] -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst)
</span><a href="GHC.Runtime.Eval.html#checkForExistence"><span class="hs-identifier hs-var">checkForExistence</span></a></span><span>
</span><span id="line-1057"></span><span>
</span><span id="line-1058"></span><span class="hs-comment">-- Parse a type string and turn any holes into skolems</span><span>
</span><span id="line-1059"></span><span id="local-6989586621681200471"><span class="annot"><a href="GHC.Runtime.Eval.html#parseInstanceHead"><span class="hs-identifier hs-type">parseInstanceHead</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200471"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200471"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span></span><span>
</span><span id="line-1060"></span><span id="parseInstanceHead"><span class="annot"><span class="annottext">parseInstanceHead :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m Kind
</span><a href="GHC.Runtime.Eval.html#parseInstanceHead"><span class="hs-identifier hs-var hs-var">parseInstanceHead</span></a></span></span><span> </span><span id="local-6989586621681199141"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199141"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Kind) -&gt; m Kind
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Kind) -&gt; m Kind) -&gt; (HscEnv -&gt; m Kind) -&gt; m Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199140"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199140"><span class="hs-identifier hs-var">hsc_env0</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1061"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681199139"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199139"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Kind, Kind) -&gt; m (Kind, Kind)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Kind, Kind) -&gt; m (Kind, Kind))
-&gt; IO (Kind, Kind) -&gt; m (Kind, Kind)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Hsc (Kind, Kind) -&gt; IO (Kind, Kind)
forall a. HscEnv -&gt; Hsc a -&gt; IO a
</span><a href="GHC.Driver.Types.html#runInteractiveHsc"><span class="hs-identifier hs-var">runInteractiveHsc</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199140"><span class="hs-identifier hs-var">hsc_env0</span></a></span><span> </span><span class="annot"><span class="annottext">(Hsc (Kind, Kind) -&gt; IO (Kind, Kind))
-&gt; Hsc (Kind, Kind) -&gt; IO (Kind, Kind)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1062"></span><span>    </span><span id="local-6989586621681199138"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199138"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Hsc HscEnv
</span><a href="GHC.Driver.Main.html#getHscEnv"><span class="hs-identifier hs-var">getHscEnv</span></a></span><span>
</span><span id="line-1063"></span><span>    </span><span id="local-6989586621681199136"><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681199136"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; Hsc (LHsType GhcPs)
</span><a href="GHC.Driver.Main.html#hscParseType"><span class="hs-identifier hs-var">hscParseType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199141"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-1064"></span><span>    </span><span class="annot"><span class="annottext">IO (Messages, Maybe (Kind, Kind)) -&gt; Hsc (Kind, Kind)
forall a. IO (Messages, Maybe a) -&gt; Hsc a
</span><a href="GHC.Driver.Main.html#ioMsgMaybe"><span class="hs-identifier hs-var">ioMsgMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Messages, Maybe (Kind, Kind)) -&gt; Hsc (Kind, Kind))
-&gt; IO (Messages, Maybe (Kind, Kind)) -&gt; Hsc (Kind, Kind)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; ZonkFlexi
-&gt; Bool
-&gt; LHsType GhcPs
-&gt; IO (Messages, Maybe (Kind, Kind))
</span><a href="GHC.Tc.Module.html#tcRnType"><span class="hs-identifier hs-var">tcRnType</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199138"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkFlexi
</span><a href="GHC.Tc.Utils.Zonk.html#SkolemiseFlexi"><span class="hs-identifier hs-var">SkolemiseFlexi</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681199136"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1065"></span><span>
</span><span id="line-1066"></span><span>  </span><span class="annot"><span class="annottext">Kind -&gt; m Kind
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199139"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1067"></span><span>
</span><span id="line-1068"></span><span class="hs-comment">-- Get all the constraints required of a dictionary binding</span><span>
</span><span id="line-1069"></span><span class="annot"><a href="GHC.Runtime.Eval.html#getDictionaryBindings"><span class="hs-identifier hs-type">getDictionaryBindings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtEvidence"><span class="hs-identifier hs-type">CtEvidence</span></a></span><span>
</span><span id="line-1070"></span><span id="getDictionaryBindings"><span class="annot"><span class="annottext">getDictionaryBindings :: Kind -&gt; TcM CtEvidence
</span><a href="GHC.Runtime.Eval.html#getDictionaryBindings"><span class="hs-identifier hs-var hs-var">getDictionaryBindings</span></a></span></span><span> </span><span id="local-6989586621681199132"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199132"><span class="hs-identifier hs-var">theta</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1071"></span><span>  </span><span id="local-6989586621681199131"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199131"><span class="hs-identifier hs-var">dictName</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; TcM Name
</span><a href="GHC.Tc.Utils.Monad.html#newName"><span class="hs-identifier hs-var">newName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkDictOcc"><span class="hs-identifier hs-var">mkDictOcc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkVarOcc"><span class="hs-identifier hs-var">mkVarOcc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;magic&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1072"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199127"><span class="annot"><span class="annottext">dict_var :: Id
</span><a href="#local-6989586621681199127"><span class="hs-identifier hs-var hs-var">dict_var</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobal"><span class="hs-identifier hs-var">mkVanillaGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681199131"><span class="hs-identifier hs-var">dictName</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199132"><span class="hs-identifier hs-var">theta</span></a></span><span>
</span><span id="line-1073"></span><span>  </span><span id="local-6989586621681199126"><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681199126"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin -&gt; Maybe TypeOrKind -&gt; TcM CtLoc
</span><a href="GHC.Tc.Utils.Monad.html#getCtLocM"><span class="hs-identifier hs-var">getCtLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SkolemInfo -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#GivenOrigin"><span class="hs-identifier hs-var">GivenOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SkolemInfo
</span><a href="GHC.Tc.Types.Origin.html#UnkSkol"><span class="hs-identifier hs-var">UnkSkol</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe TypeOrKind
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1074"></span><span>
</span><span id="line-1075"></span><span>  </span><span class="hs-comment">-- Generate a wanted here because at the end of constraint</span><span>
</span><span id="line-1076"></span><span>  </span><span class="hs-comment">-- solving, most derived constraints get thrown away, which in certain</span><span>
</span><span id="line-1077"></span><span>  </span><span class="hs-comment">-- cases, notably with quantified constraints makes it impossible to rule</span><span>
</span><span id="line-1078"></span><span>  </span><span class="hs-comment">-- out instances as invalid. (See #18071)</span><span>
</span><span id="line-1079"></span><span>  </span><span class="annot"><span class="annottext">CtEvidence -&gt; TcM CtEvidence
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CtWanted :: Kind -&gt; TcEvDest -&gt; ShadowInfo -&gt; CtLoc -&gt; CtEvidence
</span><a href="GHC.Tc.Types.Constraint.html#CtWanted"><span class="hs-identifier hs-type">CtWanted</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1080"></span><span>    </span><span class="annot"><span class="annottext">ctev_pred :: Kind
</span><a href="GHC.Tc.Types.Constraint.html#ctev_pred"><span class="hs-identifier hs-var">ctev_pred</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199127"><span class="hs-identifier hs-var">dict_var</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1081"></span><span>    </span><span class="annot"><span class="annottext">ctev_dest :: TcEvDest
</span><a href="GHC.Tc.Types.Constraint.html#ctev_dest"><span class="hs-identifier hs-var">ctev_dest</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; TcEvDest
</span><a href="GHC.Tc.Types.Constraint.html#EvVarDest"><span class="hs-identifier hs-var">EvVarDest</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199127"><span class="hs-identifier hs-var">dict_var</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1082"></span><span>    </span><span class="annot"><span class="annottext">ctev_nosh :: ShadowInfo
</span><a href="GHC.Tc.Types.Constraint.html#ctev_nosh"><span class="hs-identifier hs-var">ctev_nosh</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShadowInfo
</span><a href="GHC.Tc.Types.Constraint.html#WDeriv"><span class="hs-identifier hs-var">WDeriv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1083"></span><span>    </span><span class="annot"><span class="annottext">ctev_loc :: CtLoc
</span><a href="GHC.Tc.Types.Constraint.html#ctev_loc"><span class="hs-identifier hs-var">ctev_loc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681199126"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-1084"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-1085"></span><span>
</span><span id="line-1086"></span><span class="hs-comment">-- Find instances where the head unifies with the provided type</span><span>
</span><span id="line-1087"></span><span class="annot"><a href="GHC.Runtime.Eval.html#findMatchingInstances"><span class="hs-identifier hs-type">findMatchingInstances</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#DFunInstType"><span class="hs-identifier hs-type">DFunInstType</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1088"></span><span id="findMatchingInstances"><span class="annot"><span class="annottext">findMatchingInstances :: Kind -&gt; TcM [(ClsInst, [Maybe Kind])]
</span><a href="GHC.Runtime.Eval.html#findMatchingInstances"><span class="hs-identifier hs-var hs-var">findMatchingInstances</span></a></span></span><span> </span><span id="local-6989586621681199113"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199113"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1089"></span><span>  </span><span id="local-6989586621681199112"><span class="annot"><span class="annottext">ies :: InstEnvs
</span><a href="#local-6989586621681199112"><span class="hs-identifier hs-var">ies</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.InstEnv.html#InstEnvs"><span class="hs-identifier hs-type">InstEnvs</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">ie_global :: InstEnvs -&gt; InstEnv
</span><a href="GHC.Core.InstEnv.html#ie_global"><span class="hs-identifier hs-var">ie_global</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199109"><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681199109"><span class="hs-identifier hs-var">ie_global</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ie_local :: InstEnvs -&gt; InstEnv
</span><a href="GHC.Core.InstEnv.html#ie_local"><span class="hs-identifier hs-var">ie_local</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199107"><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681199107"><span class="hs-identifier hs-var">ie_local</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM InstEnvs
</span><a href="GHC.Tc.Utils.Env.html#tcGetInstEnvs"><span class="hs-identifier hs-var">tcGetInstEnvs</span></a></span><span>
</span><span id="line-1090"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681199106"><span class="annot"><span class="annottext">allClasses :: [Class]
</span><a href="#local-6989586621681199106"><span class="hs-identifier hs-var hs-var">allClasses</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstEnv -&gt; [Class]
</span><a href="GHC.Core.InstEnv.html#instEnvClasses"><span class="hs-identifier hs-var">instEnvClasses</span></a></span><span> </span><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681199109"><span class="hs-identifier hs-var">ie_global</span></a></span><span> </span><span class="annot"><span class="annottext">[Class] -&gt; [Class] -&gt; [Class]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">InstEnv -&gt; [Class]
</span><a href="GHC.Core.InstEnv.html#instEnvClasses"><span class="hs-identifier hs-var">instEnvClasses</span></a></span><span> </span><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681199107"><span class="hs-identifier hs-var">ie_local</span></a></span><span>
</span><span id="line-1091"></span><span>  </span><span class="annot"><span class="annottext">[(ClsInst, [Maybe Kind])] -&gt; TcM [(ClsInst, [Maybe Kind])]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([(ClsInst, [Maybe Kind])] -&gt; TcM [(ClsInst, [Maybe Kind])])
-&gt; [(ClsInst, [Maybe Kind])] -&gt; TcM [(ClsInst, [Maybe Kind])]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Class -&gt; [(ClsInst, [Maybe Kind])])
-&gt; [Class] -&gt; [(ClsInst, [Maybe Kind])]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstEnvs -&gt; Class -&gt; [(ClsInst, [Maybe Kind])]
</span><a href="#local-6989586621681199104"><span class="hs-identifier hs-var">try_cls</span></a></span><span> </span><span class="annot"><span class="annottext">InstEnvs
</span><a href="#local-6989586621681199112"><span class="hs-identifier hs-var">ies</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681199106"><span class="hs-identifier hs-var">allClasses</span></a></span><span>
</span><span id="line-1092"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1093"></span><span>  </span><span class="hs-comment">{- Check that a class instance is well-kinded.
    Since `:instances` only works for unary classes, we're looking for instances of kind
    k -&gt; Constraint where k is the type of the queried type.
  -}</span><span>
</span><span id="line-1097"></span><span>  </span><span id="local-6989586621681199104"><span class="annot"><span class="annottext">try_cls :: InstEnvs -&gt; Class -&gt; [(ClsInst, [Maybe Kind])]
</span><a href="#local-6989586621681199104"><span class="hs-identifier hs-var hs-var">try_cls</span></a></span></span><span> </span><span id="local-6989586621681199102"><span class="annot"><span class="annottext">InstEnvs
</span><a href="#local-6989586621681199102"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span id="local-6989586621681199101"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681199101"><span class="hs-identifier hs-var">cls</span></a></span></span><span>
</span><span id="line-1098"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199100"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199100"><span class="hs-identifier hs-var">arg_kind</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199099"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199099"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Maybe (Kind, Kind, Kind)
</span><a href="GHC.Core.Type.html#splitFunTy_maybe"><span class="hs-identifier hs-var">splitFunTy_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var hs-var">tyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">(TyCon -&gt; Kind) -&gt; TyCon -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Class -&gt; TyCon
</span><a href="GHC.Core.Class.html#classTyCon"><span class="hs-identifier hs-var hs-var">classTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681199101"><span class="hs-identifier hs-var">cls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1099"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#tcIsConstraintKind"><span class="hs-identifier hs-var">tcIsConstraintKind</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199099"><span class="hs-identifier hs-var">res_kind</span></a></span><span>
</span><span id="line-1100"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Kind
Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">Type.typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199113"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199100"><span class="hs-identifier hs-var">arg_kind</span></a></span><span>
</span><span id="line-1101"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681199094"><span class="annot"><span class="annottext">[(ClsInst, [Maybe Kind])]
</span><a href="#local-6989586621681199094"><span class="hs-identifier hs-var">matches</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ClsInst]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(ClsInst, [Maybe Kind])]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; InstEnvs
-&gt; Class
-&gt; [Kind]
-&gt; ([(ClsInst, [Maybe Kind])], [ClsInst],
    [(ClsInst, [Maybe Kind])])
</span><a href="GHC.Core.InstEnv.html#lookupInstEnv"><span class="hs-identifier hs-var">lookupInstEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">InstEnvs
</span><a href="#local-6989586621681199102"><span class="hs-identifier hs-var">ies</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681199101"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199113"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1102"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(ClsInst, [Maybe Kind])]
</span><a href="#local-6989586621681199094"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-1103"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1104"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1105"></span><span>
</span><span id="line-1106"></span><span>
</span><span id="line-1107"></span><span class="hs-comment">{-
  When we've found an instance that a query matches against, we still need to
  check that all the instance's constraints are satisfiable. checkForExistence
  creates an instance dictionary and verifies that any unsolved constraints
  mention a type-hole, meaning it is blocked on an unknown.

  If the instance satisfies this condition, then we return it with the query
  substituted into the instance and all constraints simplified, for example given:

  instance D a =&gt; C (MyType a b) where

  and the query `MyType _ String`

  the unsolved constraints will be [D _] so we apply the substitution:

  { a -&gt; _; b -&gt; String}

  and return the instance:

  instance D _ =&gt; C (MyType _ String)

-}</span><span>
</span><span id="line-1129"></span><span>
</span><span id="line-1130"></span><span class="annot"><a href="GHC.Runtime.Eval.html#checkForExistence"><span class="hs-identifier hs-type">checkForExistence</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.InstEnv.html#DFunInstType"><span class="hs-identifier hs-type">DFunInstType</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1131"></span><span id="checkForExistence"><span class="annot"><span class="annottext">checkForExistence :: ClsInst
-&gt; [Maybe Kind] -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst)
</span><a href="GHC.Runtime.Eval.html#checkForExistence"><span class="hs-identifier hs-var hs-var">checkForExistence</span></a></span></span><span> </span><span id="local-6989586621681199092"><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199092"><span class="hs-identifier hs-var">clsInst</span></a></span></span><span> </span><span id="local-6989586621681199091"><span class="annot"><span class="annottext">[Maybe Kind]
</span><a href="#local-6989586621681199091"><span class="hs-identifier hs-var">mb_inst_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1132"></span><span>  </span><span class="hs-comment">-- We want to force the solver to attempt to solve the constraints for clsInst.</span><span>
</span><span id="line-1133"></span><span>  </span><span class="hs-comment">-- Usually, this isn't a problem since there should only be a single instance</span><span>
</span><span id="line-1134"></span><span>  </span><span class="hs-comment">-- for a type. However, when we have overlapping instances, the solver will give up</span><span>
</span><span id="line-1135"></span><span>  </span><span class="hs-comment">-- since it can't decide which instance to use. To get around this restriction, instead</span><span>
</span><span id="line-1136"></span><span>  </span><span class="hs-comment">-- of asking the solver to solve a constraint for clsInst, we ask it to solve the</span><span>
</span><span id="line-1137"></span><span>  </span><span class="hs-comment">-- thetas of clsInst.</span><span>
</span><span id="line-1138"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681199090"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199090"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199089"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199089"><span class="hs-identifier hs-var">thetas</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Maybe Kind] -&gt; TcM ([Kind], [Kind])
</span><a href="GHC.Tc.Utils.Instantiate.html#instDFunType"><span class="hs-identifier hs-var">instDFunType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClsInst -&gt; Id
</span><a href="GHC.Core.InstEnv.html#is_dfun"><span class="hs-identifier hs-var hs-var">is_dfun</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199092"><span class="hs-identifier hs-var">clsInst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Maybe Kind]
</span><a href="#local-6989586621681199091"><span class="hs-identifier hs-var">mb_inst_tys</span></a></span><span>
</span><span id="line-1139"></span><span>  </span><span id="local-6989586621681199087"><span class="annot"><span class="annottext">[CtEvidence]
</span><a href="#local-6989586621681199087"><span class="hs-identifier hs-var">wanteds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; TcM CtEvidence)
-&gt; [Kind] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [CtEvidence]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; TcM CtEvidence
</span><a href="GHC.Runtime.Eval.html#getDictionaryBindings"><span class="hs-identifier hs-var">getDictionaryBindings</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199089"><span class="hs-identifier hs-var">thetas</span></a></span><span>
</span><span id="line-1140"></span><span>  </span><span class="hs-comment">-- It's important to zonk constraints after solving in order to expose things like TypeErrors</span><span>
</span><span id="line-1141"></span><span>  </span><span class="hs-comment">-- which otherwise appear as opaque type variables. (See #18262).</span><span>
</span><span id="line-1142"></span><span>  </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#WC"><span class="hs-identifier hs-type">WC</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">wc_simple :: WantedConstraints -&gt; Cts
</span><a href="GHC.Tc.Types.Constraint.html#wc_simple"><span class="hs-identifier hs-var">wc_simple</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199084"><span class="annot"><span class="annottext">Cts
</span><a href="#local-6989586621681199084"><span class="hs-identifier hs-var">simples</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">wc_impl :: WantedConstraints -&gt; Bag Implication
</span><a href="GHC.Tc.Types.Constraint.html#wc_impl"><span class="hs-identifier hs-var">wc_impl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681199082"><span class="annot"><span class="annottext">Bag Implication
</span><a href="#local-6989586621681199082"><span class="hs-identifier hs-var">impls</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CtEvidence] -&gt; TcM WantedConstraints
</span><a href="GHC.Tc.Solver.html#simplifyWantedsTcM"><span class="hs-identifier hs-var">simplifyWantedsTcM</span></a></span><span> </span><span class="annot"><span class="annottext">[CtEvidence]
</span><a href="#local-6989586621681199087"><span class="hs-identifier hs-var">wanteds</span></a></span><span>
</span><span id="line-1143"></span><span>
</span><span id="line-1144"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">(Ct -&gt; Bool) -&gt; Cts -&gt; Bool
forall a. (a -&gt; Bool) -&gt; Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#allBag"><span class="hs-identifier hs-var">allBag</span></a></span><span> </span><span class="annot"><span class="annottext">Ct -&gt; Bool
</span><a href="#local-6989586621681199080"><span class="hs-identifier hs-var">allowedSimple</span></a></span><span> </span><span class="annot"><span class="annottext">Cts
</span><a href="#local-6989586621681199084"><span class="hs-identifier hs-var">simples</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bag Implication -&gt; Bool
</span><a href="#local-6989586621681199079"><span class="hs-identifier hs-var">solvedImplics</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Implication
</span><a href="#local-6989586621681199082"><span class="hs-identifier hs-var">impls</span></a></span><span>
</span><span id="line-1145"></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe ClsInst -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe ClsInst -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
-&gt; (ClsInst -&gt; Maybe ClsInst)
-&gt; ClsInst
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst -&gt; Maybe ClsInst
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(ClsInst -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst))
-&gt; ClsInst -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; [Kind] -&gt; ClsInst -&gt; ClsInst
</span><a href="#local-6989586621681199078"><span class="hs-identifier hs-var">substInstArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199090"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag Kind -&gt; [Kind]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Ct -&gt; Kind) -&gt; Cts -&gt; Bag Kind
forall a b. (a -&gt; b) -&gt; Bag a -&gt; Bag b
</span><a href="GHC.Data.Bag.html#mapBag"><span class="hs-identifier hs-var">mapBag</span></a></span><span> </span><span class="annot"><span class="annottext">Ct -&gt; Kind
</span><a href="GHC.Tc.Types.Constraint.html#ctPred"><span class="hs-identifier hs-var">ctPred</span></a></span><span> </span><span class="annot"><span class="annottext">Cts
</span><a href="#local-6989586621681199084"><span class="hs-identifier hs-var">simples</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199092"><span class="hs-identifier hs-var">clsInst</span></a></span><span>
</span><span id="line-1146"></span><span>  </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe ClsInst -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe ClsInst)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ClsInst
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1147"></span><span>
</span><span id="line-1148"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1149"></span><span>  </span><span class="annot"><a href="#local-6989586621681199080"><span class="hs-identifier hs-type">allowedSimple</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#Ct"><span class="hs-identifier hs-type">Ct</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1150"></span><span>  </span><span id="local-6989586621681199080"><span class="annot"><span class="annottext">allowedSimple :: Ct -&gt; Bool
</span><a href="#local-6989586621681199080"><span class="hs-identifier hs-var hs-var">allowedSimple</span></a></span></span><span> </span><span id="local-6989586621681199074"><span class="annot"><span class="annottext">Ct
</span><a href="#local-6989586621681199074"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Bool
</span><a href="#local-6989586621681199073"><span class="hs-identifier hs-var">isSatisfiablePred</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ct -&gt; Kind
</span><a href="GHC.Tc.Types.Constraint.html#ctPred"><span class="hs-identifier hs-var">ctPred</span></a></span><span> </span><span class="annot"><span class="annottext">Ct
</span><a href="#local-6989586621681199074"><span class="hs-identifier hs-var">ct</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1151"></span><span>
</span><span id="line-1152"></span><span>  </span><span class="annot"><a href="#local-6989586621681199079"><span class="hs-identifier hs-type">solvedImplics</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#Implication"><span class="hs-identifier hs-type">Implication</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1153"></span><span>  </span><span id="local-6989586621681199079"><span class="annot"><span class="annottext">solvedImplics :: Bag Implication -&gt; Bool
</span><a href="#local-6989586621681199079"><span class="hs-identifier hs-var hs-var">solvedImplics</span></a></span></span><span> </span><span id="local-6989586621681199072"><span class="annot"><span class="annottext">Bag Implication
</span><a href="#local-6989586621681199072"><span class="hs-identifier hs-var">impls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Implication -&gt; Bool) -&gt; Bag Implication -&gt; Bool
forall a. (a -&gt; Bool) -&gt; Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#allBag"><span class="hs-identifier hs-var">allBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImplicStatus -&gt; Bool
</span><a href="GHC.Tc.Types.Constraint.html#isSolvedStatus"><span class="hs-identifier hs-var">isSolvedStatus</span></a></span><span> </span><span class="annot"><span class="annottext">(ImplicStatus -&gt; Bool)
-&gt; (Implication -&gt; ImplicStatus) -&gt; Implication -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Implication -&gt; ImplicStatus
</span><a href="GHC.Tc.Types.Constraint.html#ic_status"><span class="hs-identifier hs-var hs-var">ic_status</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bag Implication
</span><a href="#local-6989586621681199072"><span class="hs-identifier hs-var">impls</span></a></span><span>
</span><span id="line-1154"></span><span>
</span><span id="line-1155"></span><span>  </span><span class="hs-comment">-- Stricter version of isTyVarClassPred that requires all TyConApps to have at least</span><span>
</span><span id="line-1156"></span><span>  </span><span class="hs-comment">-- one argument or for the head to be a TyVar. The reason is that we want to ensure</span><span>
</span><span id="line-1157"></span><span>  </span><span class="hs-comment">-- that all residual constraints mention a type-hole somewhere in the constraint,</span><span>
</span><span id="line-1158"></span><span>  </span><span class="hs-comment">-- meaning that with the correct choice of a concrete type it could be possible for</span><span>
</span><span id="line-1159"></span><span>  </span><span class="hs-comment">-- the constraint to be discharged.</span><span>
</span><span id="line-1160"></span><span>  </span><span class="annot"><a href="#local-6989586621681199073"><span class="hs-identifier hs-type">isSatisfiablePred</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1161"></span><span>  </span><span id="local-6989586621681199073"><span class="annot"><span class="annottext">isSatisfiablePred :: Kind -&gt; Bool
</span><a href="#local-6989586621681199073"><span class="hs-identifier hs-var hs-var">isSatisfiablePred</span></a></span></span><span> </span><span id="local-6989586621681199069"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199069"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Maybe (Class, [Kind])
</span><a href="GHC.Core.Predicate.html#getClassPredTys_maybe"><span class="hs-identifier hs-var">getClassPredTys_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199069"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1162"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Class
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199067"><span class="annot"><span class="annottext">tys :: [Kind]
</span><a href="#local-6989586621681199067"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Kind]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Bool) -&gt; [Kind] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#isTyVarTy"><span class="hs-identifier hs-var">isTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199067"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-1163"></span><span>      </span><span class="annot"><span class="annottext">Maybe (Class, [Kind])
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#isTyVarTy"><span class="hs-identifier hs-var">isTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199069"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1164"></span><span>
</span><span id="line-1165"></span><span>  </span><span id="local-6989586621681199064"><span class="annot"><span class="annottext">empty_subst :: TCvSubst
</span><a href="#local-6989586621681199064"><span class="hs-identifier hs-var hs-var">empty_subst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InScopeSet -&gt; TCvSubst
</span><a href="GHC.Core.TyCo.Subst.html#mkEmptyTCvSubst"><span class="hs-identifier hs-var">mkEmptyTCvSubst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">VarSet -&gt; InScopeSet
</span><a href="GHC.Types.Var.Env.html#mkInScopeSet"><span class="hs-identifier hs-var">mkInScopeSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Kind) -&gt; Id -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst -&gt; Id
</span><a href="GHC.Core.InstEnv.html#is_dfun"><span class="hs-identifier hs-var hs-var">is_dfun</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199092"><span class="hs-identifier hs-var">clsInst</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1166"></span><span>
</span><span id="line-1167"></span><span>  </span><span class="hs-comment">{- Create a ClsInst with instantiated arguments and constraints.

     The thetas are the list of constraints that couldn't be solved because
     they mention a type-hole.
  -}</span><span>
</span><span id="line-1172"></span><span>  </span><span class="annot"><a href="#local-6989586621681199078"><span class="hs-identifier hs-type">substInstArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span>  </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html#ClsInst"><span class="hs-identifier hs-type">ClsInst</span></a></span><span>
</span><span id="line-1173"></span><span>  </span><span id="local-6989586621681199078"><span class="annot"><span class="annottext">substInstArgs :: [Kind] -&gt; [Kind] -&gt; ClsInst -&gt; ClsInst
</span><a href="#local-6989586621681199078"><span class="hs-identifier hs-var hs-var">substInstArgs</span></a></span></span><span> </span><span id="local-6989586621681199060"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199060"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span id="local-6989586621681199059"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199059"><span class="hs-identifier hs-var">thetas</span></a></span></span><span> </span><span id="local-6989586621681199058"><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199058"><span class="hs-identifier hs-var">inst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-1174"></span><span>      </span><span id="local-6989586621681199056"><span class="annot"><span class="annottext">subst :: TCvSubst
</span><a href="#local-6989586621681199056"><span class="hs-identifier hs-var hs-var">subst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TCvSubst -&gt; (Id, Kind) -&gt; TCvSubst)
-&gt; TCvSubst -&gt; [(Id, Kind)] -&gt; TCvSubst
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681199054"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199054"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681199053"><span class="annot"><span class="annottext">(Id, Kind)
</span><a href="#local-6989586621681199053"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Kind -&gt; TCvSubst) -&gt; (Id, Kind) -&gt; TCvSubst
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst -&gt; Id -&gt; Kind -&gt; TCvSubst
</span><a href="GHC.Core.TyCo.Subst.html#extendTvSubstAndInScope"><span class="hs-identifier hs-var">extendTvSubstAndInScope</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199054"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Id, Kind)
</span><a href="#local-6989586621681199053"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199064"><span class="hs-identifier hs-var">empty_subst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [Kind] -&gt; [(Id, Kind)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199051"><span class="hs-identifier hs-var">dfun_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199060"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1175"></span><span>      </span><span class="hs-comment">-- Build instance head with arguments substituted in</span><span>
</span><span id="line-1176"></span><span>      </span><span id="local-6989586621681199048"><span class="annot"><span class="annottext">tau :: Kind
</span><a href="#local-6989586621681199048"><span class="hs-identifier hs-var hs-var">tau</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; [Kind] -&gt; Kind
</span><a href="GHC.Core.Predicate.html#mkClassPred"><span class="hs-identifier hs-var">mkClassPred</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681199046"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; [Kind] -&gt; [Kind]
TCvSubst -&gt; [Kind] -&gt; [Kind]
</span><a href="GHC.Core.TyCo.Subst.html#substTheta"><span class="hs-identifier hs-var">substTheta</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681199056"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199044"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1177"></span><span>      </span><span class="hs-comment">-- Constrain the instance with any residual constraints</span><span>
</span><span id="line-1178"></span><span>      </span><span id="local-6989586621681199043"><span class="annot"><span class="annottext">phi :: Kind
</span><a href="#local-6989586621681199043"><span class="hs-identifier hs-var hs-var">phi</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#mkPhiTy"><span class="hs-identifier hs-var">mkPhiTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199059"><span class="hs-identifier hs-var">thetas</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199048"><span class="hs-identifier hs-var">tau</span></a></span><span>
</span><span id="line-1179"></span><span>      </span><span id="local-6989586621681199041"><span class="annot"><span class="annottext">sigma :: Kind
</span><a href="#local-6989586621681199041"><span class="hs-identifier hs-var hs-var">sigma</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyCoVarBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkForAllTys"><span class="hs-identifier hs-var">mkForAllTys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; TyCoVarBinder) -&gt; [Id] -&gt; [TyCoVarBinder]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681199039"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199039"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; ArgFlag -&gt; TyCoVarBinder
forall var argf. var -&gt; argf -&gt; VarBndr var argf
</span><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-var">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681199039"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="GHC.Types.Var.html#Inferred"><span class="hs-identifier hs-var">Inferred</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199051"><span class="hs-identifier hs-var">dfun_tvs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199043"><span class="hs-identifier hs-var">phi</span></a></span><span>
</span><span id="line-1180"></span><span>
</span><span id="line-1181"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199058"><span class="hs-identifier hs-var">inst</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">is_dfun :: Id
</span><a href="GHC.Core.InstEnv.html#is_dfun"><span class="hs-identifier hs-var">is_dfun</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClsInst -&gt; Id
</span><a href="GHC.Core.InstEnv.html#is_dfun"><span class="hs-identifier hs-var hs-var">is_dfun</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199058"><span class="hs-identifier hs-var">inst</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">varType :: Kind
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var">varType</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681199041"><span class="hs-identifier hs-var">sigma</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-1182"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-1183"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681199051"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681199051"><span class="hs-identifier hs-var">dfun_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199046"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681199046"><span class="hs-identifier hs-var">cls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681199044"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681199044"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClsInst -&gt; ([Id], [Kind], Class, [Kind])
</span><a href="GHC.Core.InstEnv.html#instanceSig"><span class="hs-identifier hs-var">instanceSig</span></a></span><span> </span><span class="annot"><span class="annottext">ClsInst
</span><a href="#local-6989586621681199058"><span class="hs-identifier hs-var">inst</span></a></span><span>
</span><span id="line-1184"></span><span>
</span><span id="line-1185"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-1186"></span><span class="hs-comment">-- Compile an expression, run it, and deliver the result</span><span>
</span><span id="line-1187"></span><span>
</span><span id="line-1188"></span><span class="hs-comment">-- | Parse an expression, the parsed expression can be further processed and</span><span>
</span><span id="line-1189"></span><span class="hs-comment">-- passed to compileParsedExpr.</span><span>
</span><span id="line-1190"></span><span id="local-6989586621681200437"><span class="annot"><a href="GHC.Runtime.Eval.html#parseExpr"><span class="hs-identifier hs-type">parseExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200437"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200437"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1191"></span><span id="parseExpr"><span class="annot"><span class="annottext">parseExpr :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m (LHsExpr GhcPs)
</span><a href="GHC.Runtime.Eval.html#parseExpr"><span class="hs-identifier hs-var hs-var">parseExpr</span></a></span></span><span> </span><span id="local-6989586621681199030"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199030"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m (LHsExpr GhcPs)) -&gt; m (LHsExpr GhcPs)
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m (LHsExpr GhcPs)) -&gt; m (LHsExpr GhcPs))
-&gt; (HscEnv -&gt; m (LHsExpr GhcPs)) -&gt; m (LHsExpr GhcPs)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681199029"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199029"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1192"></span><span>  </span><span class="annot"><span class="annottext">IO (LHsExpr GhcPs) -&gt; m (LHsExpr GhcPs)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (LHsExpr GhcPs) -&gt; m (LHsExpr GhcPs))
-&gt; IO (LHsExpr GhcPs) -&gt; m (LHsExpr GhcPs)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Hsc (LHsExpr GhcPs) -&gt; IO (LHsExpr GhcPs)
forall a. HscEnv -&gt; Hsc a -&gt; IO a
</span><a href="GHC.Driver.Types.html#runInteractiveHsc"><span class="hs-identifier hs-var">runInteractiveHsc</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681199029"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(Hsc (LHsExpr GhcPs) -&gt; IO (LHsExpr GhcPs))
-&gt; Hsc (LHsExpr GhcPs) -&gt; IO (LHsExpr GhcPs)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Hsc (LHsExpr GhcPs)
</span><a href="GHC.Driver.Main.html#hscParseExpr"><span class="hs-identifier hs-var">hscParseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199030"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1193"></span><span>
</span><span id="line-1194"></span><span class="hs-comment">-- | Compile an expression, run it, and deliver the resulting HValue.</span><span>
</span><span id="line-1195"></span><span id="local-6989586621681200434"><span class="annot"><a href="GHC.Runtime.Eval.html#compileExpr"><span class="hs-identifier hs-type">compileExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200434"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200434"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span></span><span>
</span><span id="line-1196"></span><span id="compileExpr"><span class="annot"><span class="annottext">compileExpr :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m HValue
</span><a href="GHC.Runtime.Eval.html#compileExpr"><span class="hs-identifier hs-var hs-var">compileExpr</span></a></span></span><span> </span><span id="local-6989586621681199019"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199019"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1197"></span><span>  </span><span id="local-6989586621681199018"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681199018"><span class="hs-identifier hs-var">parsed_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; m (LHsExpr GhcPs)
forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m (LHsExpr GhcPs)
</span><a href="GHC.Runtime.Eval.html#parseExpr"><span class="hs-identifier hs-var">parseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199019"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1198"></span><span>  </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; m HValue
forall (m :: * -&gt; *). GhcMonad m =&gt; LHsExpr GhcPs -&gt; m HValue
</span><a href="GHC.Runtime.Eval.html#compileParsedExpr"><span class="hs-identifier hs-var">compileParsedExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681199018"><span class="hs-identifier hs-var">parsed_expr</span></a></span><span>
</span><span id="line-1199"></span><span>
</span><span id="line-1200"></span><span class="hs-comment">-- | Compile an expression, run it, and deliver the resulting HValue.</span><span>
</span><span id="line-1201"></span><span id="local-6989586621681200430"><span class="annot"><a href="GHC.Runtime.Eval.html#compileExprRemote"><span class="hs-identifier hs-type">compileExprRemote</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200430"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200430"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span></span><span>
</span><span id="line-1202"></span><span id="compileExprRemote"><span class="annot"><span class="annottext">compileExprRemote :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m ForeignHValue
</span><a href="GHC.Runtime.Eval.html#compileExprRemote"><span class="hs-identifier hs-var hs-var">compileExprRemote</span></a></span></span><span> </span><span id="local-6989586621681199009"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199009"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1203"></span><span>  </span><span id="local-6989586621681199008"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681199008"><span class="hs-identifier hs-var">parsed_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; m (LHsExpr GhcPs)
forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m (LHsExpr GhcPs)
</span><a href="GHC.Runtime.Eval.html#parseExpr"><span class="hs-identifier hs-var">parseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681199009"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1204"></span><span>  </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; m ForeignHValue
forall (m :: * -&gt; *).
GhcMonad m =&gt;
LHsExpr GhcPs -&gt; m ForeignHValue
</span><a href="GHC.Runtime.Eval.html#compileParsedExprRemote"><span class="hs-identifier hs-var">compileParsedExprRemote</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681199008"><span class="hs-identifier hs-var">parsed_expr</span></a></span><span>
</span><span id="line-1205"></span><span>
</span><span id="line-1206"></span><span class="hs-comment">-- | Compile a parsed expression (before renaming), run it, and deliver</span><span>
</span><span id="line-1207"></span><span class="hs-comment">-- the resulting HValue.</span><span>
</span><span id="line-1208"></span><span id="local-6989586621681200428"><span class="annot"><a href="GHC.Runtime.Eval.html#compileParsedExprRemote"><span class="hs-identifier hs-type">compileParsedExprRemote</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200428"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200428"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span></span><span>
</span><span id="line-1209"></span><span id="compileParsedExprRemote"><span class="annot"><span class="annottext">compileParsedExprRemote :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
LHsExpr GhcPs -&gt; m ForeignHValue
</span><a href="GHC.Runtime.Eval.html#compileParsedExprRemote"><span class="hs-identifier hs-var hs-var">compileParsedExprRemote</span></a></span></span><span> </span><span id="local-6989586621681198990"><span class="annot"><span class="annottext">expr :: LHsExpr GhcPs
</span><a href="#local-6989586621681198990"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681198988"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681198988"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcPs
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m ForeignHValue) -&gt; m ForeignHValue
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m ForeignHValue) -&gt; m ForeignHValue)
-&gt; (HscEnv -&gt; m ForeignHValue) -&gt; m ForeignHValue
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681198987"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198987"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1210"></span><span>  </span><span class="hs-comment">-- &gt; let _compileParsedExpr = expr</span><span>
</span><span id="line-1211"></span><span>  </span><span class="hs-comment">-- Create let stmt from expr to make hscParsedStmt happy.</span><span>
</span><span id="line-1212"></span><span>  </span><span class="hs-comment">-- We will ignore the returned [Id], namely [expr_id], and not really</span><span>
</span><span id="line-1213"></span><span>  </span><span class="hs-comment">-- create a new binding.</span><span>
</span><span id="line-1214"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681198986"><span class="annot"><span class="annottext">expr_fs :: FastString
</span><a href="#local-6989586621681198986"><span class="hs-identifier hs-var hs-var">expr_fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_compileParsedExpr&quot;</span></span><span>
</span><span id="line-1215"></span><span>      </span><span id="local-6989586621681198984"><span class="annot"><span class="annottext">expr_name :: Name
</span><a href="#local-6989586621681198984"><span class="hs-identifier hs-var hs-var">expr_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkInternalName"><span class="hs-identifier hs-var">mkInternalName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681198986"><span class="hs-identifier hs-var">expr_fs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkTyVarOccFS"><span class="hs-identifier hs-var">mkTyVarOccFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681198986"><span class="hs-identifier hs-var">expr_fs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681198988"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-1216"></span><span>      </span><span id="local-6989586621681198981"><span class="annot"><span class="annottext">let_stmt :: GenLocated SrcSpan (StmtLR GhcPs GhcPs body)
</span><a href="#local-6989586621681198981"><span class="hs-identifier hs-var hs-var">let_stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; StmtLR GhcPs GhcPs body
-&gt; GenLocated SrcSpan (StmtLR GhcPs GhcPs body)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681198988"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(StmtLR GhcPs GhcPs body
 -&gt; GenLocated SrcSpan (StmtLR GhcPs GhcPs body))
-&gt; (HsValBindsLR GhcPs GhcPs -&gt; StmtLR GhcPs GhcPs body)
-&gt; HsValBindsLR GhcPs GhcPs
-&gt; GenLocated SrcSpan (StmtLR GhcPs GhcPs body)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">XLetStmt GhcPs GhcPs body
-&gt; LHsLocalBindsLR GhcPs GhcPs -&gt; StmtLR GhcPs GhcPs body
forall idL idR body.
XLetStmt idL idR body
-&gt; LHsLocalBindsLR idL idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-var">LetStmt</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XLetStmt GhcPs GhcPs body
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsLocalBindsLR GhcPs GhcPs -&gt; StmtLR GhcPs GhcPs body)
-&gt; (HsValBindsLR GhcPs GhcPs -&gt; LHsLocalBindsLR GhcPs GhcPs)
-&gt; HsValBindsLR GhcPs GhcPs
-&gt; StmtLR GhcPs GhcPs body
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; HsLocalBindsLR GhcPs GhcPs -&gt; LHsLocalBindsLR GhcPs GhcPs
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681198988"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsLocalBindsLR GhcPs GhcPs -&gt; LHsLocalBindsLR GhcPs GhcPs)
-&gt; (HsValBindsLR GhcPs GhcPs -&gt; HsLocalBindsLR GhcPs GhcPs)
-&gt; HsValBindsLR GhcPs GhcPs
-&gt; LHsLocalBindsLR GhcPs GhcPs
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XHsValBinds GhcPs GhcPs
-&gt; HsValBindsLR GhcPs GhcPs -&gt; HsLocalBindsLR GhcPs GhcPs
forall idL idR.
XHsValBinds idL idR
-&gt; HsValBindsLR idL idR -&gt; HsLocalBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-var">HsValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XHsValBinds GhcPs GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(HsValBindsLR GhcPs GhcPs
 -&gt; GenLocated SrcSpan (StmtLR GhcPs GhcPs body))
-&gt; HsValBindsLR GhcPs GhcPs
-&gt; GenLocated SrcSpan (StmtLR GhcPs GhcPs body)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1217"></span><span>        </span><span class="annot"><span class="annottext">XValBinds GhcPs GhcPs
-&gt; LHsBindsLR GhcPs GhcPs
-&gt; [LSig GhcPs]
-&gt; HsValBindsLR GhcPs GhcPs
forall idL idR.
XValBinds idL idR
-&gt; LHsBindsLR idL idR -&gt; [LSig idR] -&gt; HsValBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#ValBinds"><span class="hs-identifier hs-var">ValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XValBinds GhcPs GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-1218"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBind GhcPs -&gt; LHsBindsLR GhcPs GhcPs
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsBind GhcPs -&gt; LHsBindsLR GhcPs GhcPs)
-&gt; LHsBind GhcPs -&gt; LHsBindsLR GhcPs GhcPs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; RdrName -&gt; LHsExpr GhcPs -&gt; LHsBind GhcPs
</span><a href="GHC.Hs.Utils.html#mkHsVarBind"><span class="hs-identifier hs-var">mkHsVarBind</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681198988"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; RdrName
forall thing. NamedThing thing =&gt; thing -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#getRdrName"><span class="hs-identifier hs-var">getRdrName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681198984"><span class="hs-identifier hs-var">expr_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681198990"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1219"></span><span>
</span><span id="line-1220"></span><span>  </span><span id="local-6989586621681198973"><span class="annot"><span class="annottext">Maybe ([Id], ForeignHValue, FixityEnv)
</span><a href="#local-6989586621681198973"><span class="hs-identifier hs-var">pstmt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe ([Id], ForeignHValue, FixityEnv))
-&gt; m (Maybe ([Id], ForeignHValue, FixityEnv))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe ([Id], ForeignHValue, FixityEnv))
 -&gt; m (Maybe ([Id], ForeignHValue, FixityEnv)))
-&gt; IO (Maybe ([Id], ForeignHValue, FixityEnv))
-&gt; m (Maybe ([Id], ForeignHValue, FixityEnv))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; GhciLStmt GhcPs -&gt; IO (Maybe ([Id], ForeignHValue, FixityEnv))
</span><a href="GHC.Driver.Main.html#hscParsedStmt"><span class="hs-identifier hs-var">hscParsedStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198987"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">GhciLStmt GhcPs
forall {body}. GenLocated SrcSpan (StmtLR GhcPs GhcPs body)
</span><a href="#local-6989586621681198981"><span class="hs-identifier hs-var">let_stmt</span></a></span><span>
</span><span id="line-1221"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681198972"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198972"><span class="hs-identifier hs-var">hvals_io</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681198971"><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681198971"><span class="hs-identifier hs-var">fix_env</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ([Id], ForeignHValue, FixityEnv)
</span><a href="#local-6989586621681198973"><span class="hs-identifier hs-var">pstmt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1222"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span id="local-6989586621681198970"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198970"><span class="hs-identifier hs-var">_id</span></a></span></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681198969"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198969"><span class="hs-identifier hs-var">hvals_io'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681198968"><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681198968"><span class="hs-identifier hs-var">fix_env'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198969"><span class="hs-identifier hs-var">hvals_io'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681198968"><span class="hs-identifier hs-var">fix_env'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1223"></span><span>        </span><span class="annot"><span class="annottext">Maybe ([Id], ForeignHValue, FixityEnv)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; (ForeignHValue, FixityEnv)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;compileParsedExprRemote&quot;</span></span><span>
</span><span id="line-1224"></span><span>
</span><span id="line-1225"></span><span>  </span><span class="annot"><span class="annottext">FixityEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; FixityEnv -&gt; m ()
</span><a href="GHC.Runtime.Eval.html#updateFixityEnv"><span class="hs-identifier hs-var">updateFixityEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681198971"><span class="hs-identifier hs-var">fix_env</span></a></span><span>
</span><span id="line-1226"></span><span>  </span><span id="local-6989586621681198967"><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681198967"><span class="hs-identifier hs-var">status</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (EvalStatus_ [ForeignHValue] [HValueRef])
 -&gt; m (EvalStatus_ [ForeignHValue] [HValueRef]))
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
-&gt; m (EvalStatus_ [ForeignHValue] [HValueRef])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Bool
-&gt; EvalExpr ForeignHValue
-&gt; IO (EvalStatus_ [ForeignHValue] [HValueRef])
</span><a href="GHC.Runtime.Interpreter.html#evalStmt"><span class="hs-identifier hs-var">evalStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198987"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ForeignHValue -&gt; EvalExpr ForeignHValue
forall a. a -&gt; EvalExpr a
</span><a href="../../ghci/src/GHCi.Message.html#EvalThis"><span class="hs-identifier hs-var">EvalThis</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198972"><span class="hs-identifier hs-var">hvals_io</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1227"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><a href="#local-6989586621681198967"><span class="hs-identifier hs-var">status</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1228"></span><span>    </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalComplete"><span class="hs-identifier hs-type">EvalComplete</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalSuccess"><span class="hs-identifier hs-type">EvalSuccess</span></a></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681198966"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198966"><span class="hs-identifier hs-var">hval</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ForeignHValue -&gt; m ForeignHValue
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198966"><span class="hs-identifier hs-var">hval</span></a></span><span>
</span><span id="line-1229"></span><span>    </span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalComplete"><span class="hs-identifier hs-type">EvalComplete</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghci/src/GHCi.Message.html#EvalException"><span class="hs-identifier hs-type">EvalException</span></a></span><span> </span><span id="local-6989586621681198965"><span class="annot"><span class="annottext">SerializableException
</span><a href="#local-6989586621681198965"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1230"></span><span>      </span><span class="annot"><span class="annottext">IO ForeignHValue -&gt; m ForeignHValue
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ForeignHValue -&gt; m ForeignHValue)
-&gt; IO ForeignHValue -&gt; m ForeignHValue
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; IO ForeignHValue
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SerializableException -&gt; SomeException
</span><a href="../../ghci/src/GHCi.Message.html#fromSerializableException"><span class="hs-identifier hs-var">fromSerializableException</span></a></span><span> </span><span class="annot"><span class="annottext">SerializableException
</span><a href="#local-6989586621681198965"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1231"></span><span>    </span><span class="annot"><span class="annottext">EvalStatus_ [ForeignHValue] [HValueRef]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; m ForeignHValue
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;compileParsedExpr&quot;</span></span><span>
</span><span id="line-1232"></span><span>
</span><span id="line-1233"></span><span id="local-6989586621681200431"><span class="annot"><a href="GHC.Runtime.Eval.html#compileParsedExpr"><span class="hs-identifier hs-type">compileParsedExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200431"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200431"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#HValue"><span class="hs-identifier hs-type">HValue</span></a></span></span><span>
</span><span id="line-1234"></span><span id="compileParsedExpr"><span class="annot"><span class="annottext">compileParsedExpr :: forall (m :: * -&gt; *). GhcMonad m =&gt; LHsExpr GhcPs -&gt; m HValue
</span><a href="GHC.Runtime.Eval.html#compileParsedExpr"><span class="hs-identifier hs-var hs-var">compileParsedExpr</span></a></span></span><span> </span><span id="local-6989586621681198952"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681198952"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1235"></span><span>   </span><span id="local-6989586621681198951"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198951"><span class="hs-identifier hs-var">fhv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; m ForeignHValue
forall (m :: * -&gt; *).
GhcMonad m =&gt;
LHsExpr GhcPs -&gt; m ForeignHValue
</span><a href="GHC.Runtime.Eval.html#compileParsedExprRemote"><span class="hs-identifier hs-var">compileParsedExprRemote</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681198952"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1236"></span><span>   </span><span id="local-6989586621681198950"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198950"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-1237"></span><span>   </span><span class="annot"><span class="annottext">IO HValue -&gt; m HValue
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO HValue -&gt; m HValue) -&gt; IO HValue -&gt; m HValue
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; (Interp -&gt; IO HValue) -&gt; IO HValue
forall a. HscEnv -&gt; (Interp -&gt; IO a) -&gt; IO a
</span><a href="GHC.Runtime.Interpreter.html#withInterp"><span class="hs-identifier hs-var">withInterp</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198950"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">((Interp -&gt; IO HValue) -&gt; IO HValue)
-&gt; (Interp -&gt; IO HValue) -&gt; IO HValue
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681198948"><span class="annot"><span class="annottext">Interp
</span><a href="#local-6989586621681198948"><span class="hs-identifier hs-var">interp</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1238"></span><span>      </span><span class="annot"><span class="annottext">Interp -&gt; ForeignHValue -&gt; IO HValue
forall a. Interp -&gt; ForeignRef a -&gt; IO a
</span><a href="GHC.Runtime.Interpreter.html#wormhole"><span class="hs-identifier hs-var">wormhole</span></a></span><span> </span><span class="annot"><span class="annottext">Interp
</span><a href="#local-6989586621681198948"><span class="hs-identifier hs-var">interp</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198951"><span class="hs-identifier hs-var">fhv</span></a></span><span>
</span><span id="line-1239"></span><span>
</span><span id="line-1240"></span><span class="hs-comment">-- | Compile an expression, run it and return the result as a Dynamic.</span><span>
</span><span id="line-1241"></span><span id="local-6989586621681200396"><span class="annot"><a href="GHC.Runtime.Eval.html#dynCompileExpr"><span class="hs-identifier hs-type">dynCompileExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200396"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200396"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Dynamic.html#Dynamic"><span class="hs-identifier hs-type">Dynamic</span></a></span></span><span>
</span><span id="line-1242"></span><span id="dynCompileExpr"><span class="annot"><span class="annottext">dynCompileExpr :: forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m Dynamic
</span><a href="GHC.Runtime.Eval.html#dynCompileExpr"><span class="hs-identifier hs-var hs-var">dynCompileExpr</span></a></span></span><span> </span><span id="local-6989586621681198936"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198936"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1243"></span><span>  </span><span id="local-6989586621681198935"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681198935"><span class="hs-identifier hs-var">parsed_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; m (LHsExpr GhcPs)
forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m (LHsExpr GhcPs)
</span><a href="GHC.Runtime.Eval.html#parseExpr"><span class="hs-identifier hs-var">parseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198936"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1244"></span><span>  </span><span class="hs-comment">-- &gt; Data.Dynamic.toDyn expr</span><span>
</span><span id="line-1245"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681198934"><span class="annot"><span class="annottext">loc :: SrcSpan
</span><a href="#local-6989586621681198934"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681198935"><span class="hs-identifier hs-var">parsed_expr</span></a></span><span>
</span><span id="line-1246"></span><span>      </span><span id="local-6989586621681198931"><span class="annot"><span class="annottext">to_dyn_expr :: LHsExpr GhcPs
</span><a href="#local-6989586621681198931"><span class="hs-identifier hs-var hs-var">to_dyn_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; LHsExpr GhcPs -&gt; LHsExpr GhcPs
forall (id :: Pass).
LHsExpr (GhcPass id)
-&gt; LHsExpr (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#mkHsApp"><span class="hs-identifier hs-var">mkHsApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr GhcPs -&gt; LHsExpr GhcPs
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681198934"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcPs -&gt; LHsExpr GhcPs)
-&gt; (RdrName -&gt; HsExpr GhcPs) -&gt; RdrName -&gt; LHsExpr GhcPs
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">XVar GhcPs -&gt; Located (IdP GhcPs) -&gt; HsExpr GhcPs
forall p. XVar p -&gt; Located (IdP p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsVar"><span class="hs-identifier hs-var">HsVar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XVar GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; HsExpr GhcPs)
-&gt; (RdrName -&gt; Located RdrName) -&gt; RdrName -&gt; HsExpr GhcPs
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; RdrName -&gt; Located RdrName
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681198934"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; LHsExpr GhcPs) -&gt; RdrName -&gt; LHsExpr GhcPs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; RdrName
forall thing. NamedThing thing =&gt; thing -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#getRdrName"><span class="hs-identifier hs-var">getRdrName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#toDynName"><span class="hs-identifier hs-var">toDynName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1247"></span><span>                            </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681198935"><span class="hs-identifier hs-var">parsed_expr</span></a></span><span>
</span><span id="line-1248"></span><span>  </span><span id="local-6989586621681198928"><span class="annot"><span class="annottext">HValue
</span><a href="#local-6989586621681198928"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; m HValue
forall (m :: * -&gt; *). GhcMonad m =&gt; LHsExpr GhcPs -&gt; m HValue
</span><a href="GHC.Runtime.Eval.html#compileParsedExpr"><span class="hs-identifier hs-var">compileParsedExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681198931"><span class="hs-identifier hs-var">to_dyn_expr</span></a></span><span>
</span><span id="line-1249"></span><span>  </span><span class="annot"><span class="annottext">Dynamic -&gt; m Dynamic
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HValue -&gt; Dynamic
forall a b. a -&gt; b
</span><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce"><span class="hs-identifier hs-var">unsafeCoerce</span></a></span><span> </span><span class="annot"><span class="annottext">HValue
</span><a href="#local-6989586621681198928"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Dynamic.html#Dynamic"><span class="hs-identifier hs-type">Dynamic</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1250"></span><span>
</span><span id="line-1251"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-1252"></span><span class="hs-comment">-- show a module and it's source/object filenames</span><span>
</span><span id="line-1253"></span><span>
</span><span id="line-1254"></span><span id="local-6989586621681200383"><span class="annot"><a href="GHC.Runtime.Eval.html#showModule"><span class="hs-identifier hs-type">showModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200383"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200383"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-1255"></span><span id="showModule"><span class="annot"><span class="annottext">showModule :: forall (m :: * -&gt; *). GhcMonad m =&gt; ModSummary -&gt; m String
</span><a href="GHC.Runtime.Eval.html#showModule"><span class="hs-identifier hs-var hs-var">showModule</span></a></span></span><span> </span><span id="local-6989586621681198918"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681198918"><span class="hs-identifier hs-var">mod_summary</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1256"></span><span>    </span><span class="annot"><span class="annottext">(HscEnv -&gt; m String) -&gt; m String
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m String) -&gt; m String)
-&gt; (HscEnv -&gt; m String) -&gt; m String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681198917"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198917"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1257"></span><span>        </span><span id="local-6989586621681198916"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681198916"><span class="hs-identifier hs-var">interpreted</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; m Bool
forall (m :: * -&gt; *). GhcMonad m =&gt; ModSummary -&gt; m Bool
</span><a href="GHC.Runtime.Eval.html#moduleIsBootOrNotObjectLinkable"><span class="hs-identifier hs-var">moduleIsBootOrNotObjectLinkable</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681198918"><span class="hs-identifier hs-var">mod_summary</span></a></span><span>
</span><span id="line-1258"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681198915"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681198915"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198917"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-1259"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; m String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget -&gt; Bool -&gt; ModSummary -&gt; String
</span><a href="GHC.Driver.Types.html#showModMsg"><span class="hs-identifier hs-var">showModMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681198915"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var hs-var">hscTarget</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681198915"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681198916"><span class="hs-identifier hs-var">interpreted</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681198918"><span class="hs-identifier hs-var">mod_summary</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1260"></span><span>
</span><span id="line-1261"></span><span id="local-6989586621681200380"><span class="annot"><a href="GHC.Runtime.Eval.html#moduleIsBootOrNotObjectLinkable"><span class="hs-identifier hs-type">moduleIsBootOrNotObjectLinkable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681200380"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200380"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-1262"></span><span id="moduleIsBootOrNotObjectLinkable"><span class="annot"><span class="annottext">moduleIsBootOrNotObjectLinkable :: forall (m :: * -&gt; *). GhcMonad m =&gt; ModSummary -&gt; m Bool
</span><a href="GHC.Runtime.Eval.html#moduleIsBootOrNotObjectLinkable"><span class="hs-identifier hs-var hs-var">moduleIsBootOrNotObjectLinkable</span></a></span></span><span> </span><span id="local-6989586621681198905"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681198905"><span class="hs-identifier hs-var">mod_summary</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Bool) -&gt; m Bool
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Bool) -&gt; m Bool) -&gt; (HscEnv -&gt; m Bool) -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681198904"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198904"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1263"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomePackageTable -&gt; ModuleName -&gt; Maybe HomeModInfo
</span><a href="GHC.Driver.Types.html#lookupHpt"><span class="hs-identifier hs-var">lookupHpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HomePackageTable
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198904"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; ModuleName
</span><a href="GHC.Driver.Types.html#ms_mod_name"><span class="hs-identifier hs-var">ms_mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681198905"><span class="hs-identifier hs-var">mod_summary</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1264"></span><span>        </span><span class="annot"><span class="annottext">Maybe HomeModInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; m Bool
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;missing linkable&quot;</span></span><span>
</span><span id="line-1265"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681198902"><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681198902"><span class="hs-identifier hs-var">mod_info</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; m Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; m Bool) -&gt; Bool -&gt; m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; Maybe Linkable
</span><a href="GHC.Driver.Types.html#hm_linkable"><span class="hs-identifier hs-var hs-var">hm_linkable</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo
</span><a href="#local-6989586621681198902"><span class="hs-identifier hs-var">mod_info</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1266"></span><span>          </span><span class="annot"><span class="annottext">Maybe Linkable
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1267"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681198900"><span class="annot"><span class="annottext">Linkable
</span><a href="#local-6989586621681198900"><span class="hs-identifier hs-var">linkable</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Linkable -&gt; Bool
</span><a href="GHC.Driver.Types.html#isObjectLinkable"><span class="hs-identifier hs-var">isObjectLinkable</span></a></span><span> </span><span class="annot"><span class="annottext">Linkable
</span><a href="#local-6989586621681198900"><span class="hs-identifier hs-var">linkable</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1268"></span><span>
</span><span id="line-1269"></span><span class="hs-comment">----------------------------------------------------------------------------</span><span>
</span><span id="line-1270"></span><span class="hs-comment">-- RTTI primitives</span><span>
</span><span id="line-1271"></span><span>
</span><span id="line-1272"></span><span id="local-6989586621681200376"><span class="annot"><a href="GHC.Runtime.Eval.html#obtainTermFromVal"><span class="hs-identifier hs-type">obtainTermFromVal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681200376"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span></span><span class="hs-cpp">
#if defined(HAVE_INTERNAL_INTERPRETER)
</span><span id="obtainTermFromVal"><span class="annot"><span class="annottext">obtainTermFromVal :: forall a. HscEnv -&gt; Int -&gt; Bool -&gt; Kind -&gt; a -&gt; IO Term
</span><a href="GHC.Runtime.Eval.html#obtainTermFromVal"><span class="hs-identifier hs-var hs-var">obtainTermFromVal</span></a></span></span><span> </span><span id="local-6989586621681198896"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198896"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681198895"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681198895"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621681198894"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681198894"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621681198893"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681198893"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681198892"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681198892"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; (Interp -&gt; IO Term) -&gt; IO Term
forall a. HscEnv -&gt; (Interp -&gt; IO a) -&gt; IO a
</span><a href="GHC.Runtime.Interpreter.html#withInterp"><span class="hs-identifier hs-var">withInterp</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198896"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">((Interp -&gt; IO Term) -&gt; IO Term) -&gt; (Interp -&gt; IO Term) -&gt; IO Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-1275"></span><span>  </span><span class="annot"><span class="annottext">Interp
</span><a href="GHC.Runtime.Interpreter.Types.html#InternalInterp"><span class="hs-identifier hs-var">InternalInterp</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Int -&gt; Bool -&gt; Kind -&gt; ForeignHValue -&gt; IO Term
</span><a href="GHC.Runtime.Heap.Inspect.html#cvObtainTerm"><span class="hs-identifier hs-var">cvObtainTerm</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198896"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681198895"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681198894"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681198893"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ForeignHValue
forall a b. a -&gt; b
</span><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce"><span class="hs-identifier hs-var">unsafeCoerce</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681198892"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span class="hs-identifier">obtainTermFromVal</span><span> </span><span class="hs-identifier">hsc_env</span><span> </span><span class="hs-identifier">_bound</span><span> </span><span class="hs-identifier">_force</span><span> </span><span class="hs-identifier">_ty</span><span> </span><span class="hs-identifier">_x</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">withInterp</span><span> </span><span class="hs-identifier">hsc_env</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="GHC.Runtime.Interpreter.Types.html#ExternalInterp"><span class="hs-identifier hs-type">ExternalInterp</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO Term
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#InstallationError"><span class="hs-identifier hs-var">InstallationError</span></a></span><span>
</span><span id="line-1280"></span><span>                        </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;this operation requires -fno-external-interpreter&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1281"></span><span>
</span><span id="line-1282"></span><span class="annot"><a href="GHC.Runtime.Eval.html#obtainTermFromId"><span class="hs-identifier hs-type">obtainTermFromId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span>
</span><span id="line-1283"></span><span id="obtainTermFromId"><span class="annot"><span class="annottext">obtainTermFromId :: HscEnv -&gt; Int -&gt; Bool -&gt; Id -&gt; IO Term
</span><a href="GHC.Runtime.Eval.html#obtainTermFromId"><span class="hs-identifier hs-var hs-var">obtainTermFromId</span></a></span></span><span> </span><span id="local-6989586621681198888"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198888"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681198887"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681198887"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621681198886"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681198886"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621681198885"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198885"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="hs-keyword">do</span><span>
</span><span id="line-1284"></span><span>  </span><span id="local-6989586621681198884"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198884"><span class="hs-identifier hs-var">hv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Name -&gt; IO ForeignHValue
</span><a href="GHC.Runtime.Linker.html#getHValue"><span class="hs-identifier hs-var">Linker.getHValue</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198888"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Var.html#varName"><span class="hs-identifier hs-var hs-var">varName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198885"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1285"></span><span>  </span><span class="annot"><span class="annottext">HscEnv -&gt; Int -&gt; Bool -&gt; Kind -&gt; ForeignHValue -&gt; IO Term
</span><a href="GHC.Runtime.Heap.Inspect.html#cvObtainTerm"><span class="hs-identifier hs-var">cvObtainTerm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; HscEnv
</span><a href="#local-6989586621681198881"><span class="hs-identifier hs-var">updEnv</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198888"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681198887"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681198886"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198885"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198884"><span class="hs-identifier hs-var">hv</span></a></span><span>
</span><span id="line-1286"></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681198881"><span class="annot"><span class="annottext">updEnv :: HscEnv -&gt; HscEnv
</span><a href="#local-6989586621681198881"><span class="hs-identifier hs-var hs-var">updEnv</span></a></span></span><span> </span><span id="local-6989586621681198880"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198880"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198880"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span>                             </span><span class="hs-comment">-- #14828</span><span>
</span><span id="line-1287"></span><span>            </span><span class="annot"><span class="annottext">DynFlags -&gt; Extension -&gt; DynFlags
</span><a href="GHC.Driver.Session.html#xopt_set"><span class="hs-identifier hs-var">xopt_set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198880"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#ImpredicativeTypes"><span class="hs-identifier hs-var">ImpredicativeTypes</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-1288"></span><span>         </span><span class="hs-comment">-- See Note [Setting ImpredicativeTypes for :print command]</span><span>
</span><span id="line-1289"></span><span>
</span><span id="line-1290"></span><span class="hs-comment">-- Uses RTTI to reconstruct the type of an Id, making it less polymorphic</span><span>
</span><span id="line-1291"></span><span class="annot"><a href="GHC.Runtime.Eval.html#reconstructType"><span class="hs-identifier hs-type">reconstructType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1292"></span><span id="reconstructType"><span class="annot"><span class="annottext">reconstructType :: HscEnv -&gt; Int -&gt; Id -&gt; IO (Maybe Kind)
</span><a href="GHC.Runtime.Eval.html#reconstructType"><span class="hs-identifier hs-var hs-var">reconstructType</span></a></span></span><span> </span><span id="local-6989586621681198877"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198877"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681198876"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681198876"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621681198875"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198875"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1293"></span><span>  </span><span id="local-6989586621681198874"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198874"><span class="hs-identifier hs-var">hv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Name -&gt; IO ForeignHValue
</span><a href="GHC.Runtime.Linker.html#getHValue"><span class="hs-identifier hs-var">Linker.getHValue</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198877"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Var.html#varName"><span class="hs-identifier hs-var hs-var">varName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198875"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1294"></span><span>  </span><span class="annot"><span class="annottext">HscEnv -&gt; Int -&gt; Kind -&gt; ForeignHValue -&gt; IO (Maybe Kind)
</span><a href="GHC.Runtime.Heap.Inspect.html#cvReconstructType"><span class="hs-identifier hs-var">cvReconstructType</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198877"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681198876"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198875"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681198874"><span class="hs-identifier hs-var">hv</span></a></span><span>
</span><span id="line-1295"></span><span>
</span><span id="line-1296"></span><span class="annot"><a href="GHC.Runtime.Eval.html#mkRuntimeUnkTyVar"><span class="hs-identifier hs-type">mkRuntimeUnkTyVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span>
</span><span id="line-1297"></span><span id="mkRuntimeUnkTyVar"><span class="annot"><span class="annottext">mkRuntimeUnkTyVar :: Name -&gt; Kind -&gt; Id
</span><a href="GHC.Runtime.Eval.html#mkRuntimeUnkTyVar"><span class="hs-identifier hs-var hs-var">mkRuntimeUnkTyVar</span></a></span></span><span> </span><span id="local-6989586621681198871"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681198871"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681198870"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681198870"><span class="hs-identifier hs-var">kind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; TcTyVarDetails -&gt; Id
</span><a href="GHC.Types.Var.html#mkTcTyVar"><span class="hs-identifier hs-var">mkTcTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681198871"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681198870"><span class="hs-identifier hs-var">kind</span></a></span><span> </span><span class="annot"><span class="annottext">TcTyVarDetails
</span><a href="GHC.Tc.Utils.TcType.html#RuntimeUnk"><span class="hs-identifier hs-var">RuntimeUnk</span></a></span><span>
</span><span id="line-1298"></span><span>
</span><span id="line-1299"></span><span>
</span><span id="line-1300"></span><span class="hs-comment">{-
Note [Setting ImpredicativeTypes for :print command]

If ImpredicativeTypes is not enabled, then `:print &lt;term&gt;` will fail if the
type of &lt;term&gt; has nested `forall`s or `=&gt;`s.
This is because the GHCi debugger's internals will attempt to unify a
metavariable with the type of &lt;term&gt; and then display the result, but if the
type has nested `forall`s or `=&gt;`s, then unification will fail.
As a result, `:print` will bail out and the unhelpful result will be
`&lt;term&gt; = (_t1::t1)` (where `t1` is a metavariable).

Beware: &lt;term&gt; can have nested `forall`s even if its definition doesn't use
RankNTypes! Here is an example from #14828:

  class Functor f where
    fmap :: (a -&gt; b) -&gt; f a -&gt; f b

Somewhat surprisingly, `:print fmap` considers the type of fmap to have
nested foralls. This is because the GHCi debugger sees the type
`fmap :: forall f. Functor f =&gt; forall a b. (a -&gt; b) -&gt; f a -&gt; f b`.
We could envision deeply instantiating this type to get the type
`forall f a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b`,
but this trick wouldn't work for higher-rank types.

Instead, we adopt a simpler fix: enable `ImpredicativeTypes` when using
`:print` and friends in the GHCi debugger. This allows metavariables
to unify with types that have nested (or higher-rank) `forall`s/`=&gt;`s,
which makes `:print fmap` display as
`fmap = (_t1::forall a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b)`, as expected.

Although ImpredicativeTypes is a somewhat unpredictable from a type inference
perspective, there is no danger in using it in the GHCi debugger, since all
of the terms that the GHCi debugger deals with have already been typechecked.
-}</span><span>
</span><span id="line-1334"></span></pre></body></html>